Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
description Overview of the capabilities of AIML API text models (LLMs).
icon text-size

Text Models (LLM)

Overview

The AI/ML API provides access to text-based models, also known as Large Language Models (LLMs), and allows you to interact with them through natural language (that's why a third common name for such models is chat models). These models can be applied to various tasks, enabling the creation of diverse applications using our API. For example, text models can be used to:

  • Create a system that searches your photos using text prompts.
  • Act as a psychological supporter.
  • Play games with you through natural language.
  • Assist you with coding.
  • Perform a security assessment (pentests) on servers for vulnerabilities.
  • Write documentation for your services.
  • Serve as a grammar corrector for multiple languages with deep context understanding.
  • And much more.
Specific Capabilities

There are several capabilities of text models that are worth mentioning separately.

Completion allows the model to analyze a given text fragment and predict how it might continue based on the probabilities of the next possible tokens or characters. Chat Completion extends this functionality, enabling a simulated dialogue between the user and the model based on predefined roles (e.g., "strict language teacher" and "student"). A detailed description and examples can be found in our Completion and Chat Completion article.


An evolution of chat completion includes Assistants (preconfigured conversational agents with specific roles) and Threads (a mechanism for maintaining conversation history for context). Examples of this functionality can be found in the Managing Assistants & Threads article.


Function Calling allows a chat model to invoke external programmatic tools (e.g., a function you have written) while generating a response. A detailed description and examples are available in the Function Calling article.

Endpoint

All text and chat models use the same endpoint:

https://api.aimlapi.com/v1/chat/completions

The parameters may vary (especially for models from different developers), so it’s best to check the API schema on each model’s page for details. Example: o4-mini.

Quick Code Example

We will call the gpt-4o model using the Python programming language and the OpenAI SDK.

{% hint style="info" %} If you need a more detailed explanation of how to call a model's API in code, check out our QUICKSTART section. {% endhint %}

{% code overflow="wrap" %}

%pip install openai
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.aimlapi.com/v1",

    # Insert your AIML API Key in the quotation marks instead of <YOUR_AIMLAPI_KEY>:
    api_key="<YOUR_AIMLAPI_KEY>",  
)

response = client.chat.completions.create(
    model="gpt-4o",
    messages=[
        {
            "role": "system",
            "content": "You are an AI assistant who knows everything.",
        },
        {
            "role": "user",
            "content": "Tell me, why is the sky blue?"
        },
    ],
)

message = response.choices[0].message.content

print(f"Assistant: {message}")

{% endcode %}

By running this code example, we received the following response from the chat model:

{% code overflow="wrap" %}

Assistant: The sky appears blue due to a phenomenon called Rayleigh scattering. When sunlight enters Earth's atmosphere, it collides with gas molecules and small particles. Sunlight is made up of different colors, each with different wavelengths. Blue light has a shorter wavelength and is scattered in all directions by the gas molecules in the atmosphere more than other colors with longer wavelengths, such as red or yellow.
As a result, when you look up at the sky during the day, you see this scattered blue light being dispersed in all directions, making the sky appear blue to our eyes. During sunrise and sunset, the sun's light passes through a greater thickness of Earth's atmosphere, scattering the shorter blue wavelengths out of your line of sight and leaving the longer wavelengths, like red and orange, more dominant, which is why the sky often turns those colors at those times.

{% endcode %}

Complete Text Model List
Model ID + API Reference linkDeveloperContextModel Card
gpt-3.5-turboOpen AI16,000Chat GPT 3.5 Turbo
gpt-3.5-turbo-0125Open AI16,000Chat GPT-3.5 Turbo 0125
gpt-3.5-turbo-1106Open AI16,000Chat GPT-3.5 Turbo 1106
gpt-4oOpen AI128,000Chat GPT-4o
gpt-4o-2024-08-06Open AI128,000GPT-4o-2024-08-06
gpt-4o-2024-05-13Open AI128,000GPT-4o-2024-05-13
gpt-4o-miniOpen AI128,000Chat GPT 4o mini
gpt-4o-mini-2024-07-18Open AI128,000GPT 4o mini
gpt-4o-audio-previewOpen AI128,000GPT-4o Audio Preview
gpt-4o-mini-audio-previewOpen AI128,000GPT-4o mini Audio
gpt-4o-search-previewOpen AI128,000GPT-4o Search Preview
gpt-4o-mini-search-previewOpen AI128,000GPT-4o Mini Search Preview
gpt-4-turboOpen AI128,000Chat GPT 4 Turbo
gpt-4-turbo-2024-04-09Open AI128,000-
gpt-4Open AI8,000Chat GPT 4
gpt-4-0125-previewOpen AI8,000-
gpt-4-1106-previewOpen AI8,000-
o1Open AI200,000OpenAI o1
openai/o3-2025-04-16Open AI200,000o3
o3-miniOpen AI200,000OpenAI o3 mini
openai/o3-proOpen AI200,000o3-pro
openai/gpt-4.1-2025-04-14Open AI1,000,000GPT-4.1
openai/gpt-4.1-mini-2025-04-14Open AI1,000,000GPT-4.1 Mini
openai/gpt-4.1-nano-2025-04-14Open AI1,000,000GPT-4.1 Nano
openai/o4-mini-2025-04-16Open AI200,000GPT-o4-mini-2025-04-16
openai/gpt-oss-20bOpen AI128,000GPT OSS 20B
openai/gpt-oss-120bOpen AI128,000GPT OSS 120B
openai/gpt-5-2025-08-07Open AI400,000GPT-5
openai/gpt-5-mini-2025-08-07Open AI400,000GPT-5 Mini
openai/gpt-5-nano-2025-08-07Open AI400,000GPT-5 Nano
openai/gpt-5-chat-latestOpen AI400,000GPT-5 Chat
openai/gpt-5-1Open AI128,000GPT-5.1
openai/gpt-5-1-chat-latestOpen AI128,000GPT-5.1 Chat Latest
openai/gpt-5-1-codexOpen AI400,000GPT-5.1 Codex
openai/gpt-5-1-codex-miniOpen AI400,000GPT-5.1 Codex Mini
openai/gpt-5-2Open AI400,000GPT-5.2
openai/gpt-5-2-chat-latestOpen AI400,000GPT-5.2 Chat Latest
openai/gpt-5-2-proOpen AI400,000GPT-5.2 Pro
openai/gpt-5-2-codexOpen AI400,000GPT-5.2 Codex
openai/gpt-5-3-codexOpen AI400,000GPT-5.3 Codex
openai/gpt-5-4Open AI1,000,000GPT-5.4
openai/gpt-5-4-proOpen AI1,000,000GPT-5.4 Pro
anthropic/claude-opus-4Anthropic200,000Claude 4 Opus
anthropic/claude-opus-4.1
claude-opus-4-1
claude-opus-4-1-20250805
Anthropic200,000Claude Opus 4.1
anthropic/claude-sonnet-4Anthropic200,000Claude 4 Sonnet

claude-sonnet-4-5-20250929

anthropic/claude-sonnet-4.5

claude-sonnet-4-5

Anthropic200,000Claude 4.5 Sonnet

anthropic/claude-haiku-4.5
claude-haiku-4-5

claude-haiku-4-5-20251001

Anthropic200,000Claude 4.5 Haiku
anthropic/claude-opus-4-5
claude-opus-4-5
claude-opus-4-5-20251101
Anthropic200,000Claude 4.5 Opus
anthropic/claude-opus-4-6Anthropic200,000Claude 4.6 Opus
anthropic/claude-sonnet-4.6
anthropic/claude-sonnet-4-6-20260218
Anthropic200,000Claude Sonnet 4.6
anthropic/claude-opus-4-7
claude-opus-4-7
Anthropic1,000,000Coming Soon
Qwen/Qwen2.5-7B-Instruct-TurboAlibaba Cloud32,000Qwen 2.5 7B Instruct Turbo
qwen-maxAlibaba Cloud32,000Qwen Max
qwen-max-2025-01-25Alibaba Cloud32,000Qwen Max 2025-01-25
qwen-plusAlibaba Cloud131,000Qwen Plus
qwen-turboAlibaba Cloud1,000,000Qwen Turbo
alibaba/qwen3-32bAlibaba Cloud131,000Qwen3-32B
alibaba/qwen3-coder-480b-a35b-instructAlibaba Cloud262,000Qwen3 Coder
alibaba/qwen3-235b-a22b-thinking-2507Alibaba Cloud262,000Qwen3 235B A22B Thinking
alibaba/qwen3-next-80b-a3b-instructAlibaba Cloud262,000Qwen3-Next-80B-A3B Instruct
alibaba/qwen3-next-80b-a3b-thinkingAlibaba Cloud262,000Qwen3-Next-80B-A3B Thinking
alibaba/qwen3-max-previewAlibaba Cloud258,000Qwen3-Max Preview
alibaba/qwen3-max-instructAlibaba Cloud262,000Qwen3-Max Instruct
qwen3-omni-30b-a3b-captionerAlibaba Cloud65,000qwen3-omni-30b-a3b-captioner
alibaba/qwen3-vl-32b-instructAlibaba Cloud126,000Qwen3 VL 32B Instruct
alibaba/qwen3-vl-32b-thinkingAlibaba Cloud126,000Qwen3 VL 32B Thinking
alibaba/qwen3.5-plus-20260218Alibaba Cloud1,000,000Qwen3.5 Plus
alibaba/qwen3.5-omni-plusAlibaba Cloud256,000Coming Soon
alibaba/qwen3.5-omni-flashAlibaba Cloud256,000Coming Soon
alibaba/qwen3.6-27bAlibaba Cloud262,144Coming Soon
anthracite-org/magnum-v4-72bAnthracite32,000Magnum v4 72B
baidu/ernie-4-5-8k-previewBaidu8,000ERNIE 4.5
baidu/ernie-4.5-0.3bBaidu120,000ERNIE 4.5
baidu/ernie-4.5-21b-a3bBaidu120,000ERNIE 4.5
baidu/ernie-4.5-21b-a3b-thinkingBaidu131,000ERNIE 4.5
baidu/ernie-4.5-vl-28b-a3bBaidu30,000ERNIE 4.5 VL
baidu/ernie-4.5-vl-424b-a47bBaidu123,000ERNIE 4.5 VL
baidu/ernie-4.5-300b-a47bBaidu123,000ERNIE 4.5
baidu/ernie-4.5-300b-a47b-paddleBaidu123,000ERNIE 4.5
baidu/ernie-4-5-turbo-128kBaidu128,000ERNIE 4.5
baidu/ernie-4-5-turbo-vl-32kBaidu32,000ERNIE 4.5 VL
baidu/ernie-5-0-thinking-previewBaidu128,000ERNIE 5.0
baidu/ernie-5-0-thinking-latestBaidu128,000ERNIE 5.0
baidu/ernie-x1-turbo-32kBaidu32,000Coming Soon
baidu/ernie-x1-1-previewBaidu64,000Coming Soon
bytedance/seed-1-8ByteDance256,000Seed 1.8
cohere/command-aCohere256,000Command A
deepseek-chat or
deepseek/deepseek-chat or
deepseek/deepseek-chat-v3-0324
DeepSeek128,000DeepSeek V3
deepseek/deepseek-r1 or
deepseek-reasoner
DeepSeek128,000DeepSeek R1
deepseek/deepseek-chat-v3.1DeepSeek128,000DeepSeek V3.1 Chat
deepseek/deepseek-reasoner-v3.1DeepSeek128,000DeepSeek V3.1 Reasoner
deepseek/deepseek-thinking-v3.2-expDeepSeek128,000DeepSeek V3.2-Exp Thinking
deepseek/deepseek-non-thinking-v3.2-expDeepSeek128,000DeepSeek V3.2-Exp Non-Thinking
deepseek/deepseek-reasoner-v3.1-terminusDeepSeek128,000DeepSeek V3.1 Terminus Reasoning
deepseek/deepseek-non-reasoner-v3.1-terminusDeepSeek128,000DeepSeek V3.1 Terminus Non-Reasoning
deepseek/deepseek-v3.2-specialeDeepSeek128,000DeepSeek V3.2 Speciale
deepseek/deepseek-v4-proDeepSeek1,000,000Coming Soon
deepseek/deepseek-v4-flashDeepSeek1,000,000Coming Soon
gemini-2.0-flashGoogle1,000,000Gemini 2.0 Flash
google/gemini-2.5-flash-lite-previewGoogle1,000,000
google/gemini-2.5-flashGoogle1,000,000Gemini 2.5 Flash
google/gemini-3-flash-previewGoogle1,000,000Gemini 3 Flash
google/gemini-2.5-proGoogle1,000,000Gemini 2.5 Pro
google/gemma-3-4b-itGoogle128,000Gemma 3 (4B)
google/gemma-3-12b-itGoogle128,000Gemma 3 (12B)
google/gemma-3-27b-itGoogle128,000Gemma 3 (27B)
google/gemma-3n-e4b-itGoogle8,192Gemma 3n 4B
google/gemini-3-1-pro-previewGoogle1,000,000Gemini 3.1 Pro
google/gemini-3-1-flash-lite-previewGoogle1,048,576Coming Soon
google/gemma-4-31b-itGoogle262,000Gemma 4 31B
gryphe/mythomax-l2-13bGryphe4,000MythoMax-L2 (13B)
meta-llama/Llama-3.3-70B-Instruct-TurboMeta128,000Meta Llama 3.3 70B Instruct Turbo
meta-llama/Meta-Llama-3-8B-Instruct-LiteMeta9,000Llama 3 8B Instruct Lite
meta-llama/llama-3.3-70b-versatileMeta131,000Llama 3.3 70B Versatile
MiniMax-Text-01MiniMax1,000,000MiniMax-Text-01
minimax/m1MiniMax1,000,000MiniMax M1
minimax/m2MiniMax200,000MiniMax M2
minimax/m2-herMiniMax200,000MiniMax M2-her
minimax/m2-1MiniMax204,800MiniMax M2.1
minimax/m2-1-highspeedMiniMax204,800MiniMax M2.1 Highspeed
minimax/m2-5-20260218MiniMax204,800MiniMax M2.5
minimax/m2-5-highspeed-20260218MiniMax204,800MiniMax M2.5
minimax/m2-7-20260402MiniMax204,800MiniMax M2.7
minimax/m2-7-highspeedMiniMax204,800MiniMax M2.7 Highspeed
mistralai/Mixtral-8x7B-Instruct-v0.1Mistral AI64,000Mixtral-8x7B Instruct v0.1
mistralai/mistral-nemoMistral AI128,000Mistral Nemo
moonshot/kimi-k2-previewMoonshot131,000Kimi-K2
moonshot/kimi-k2-0905-previewMoonshot256,000Kimi-K2
moonshot/kimi-k2-turbo-previewMoonshot256,000Kimi K2 Turbo Preview
moonshot/kimi-k2-5Moonshot262,000Kimi K2.5
moonshot/kimi-k2-6Moonshot256,000Coming Soon
nousresearch/hermes-4-405bNousResearch131,000-
nvidia/llama-3.1-nemotron-70b-instructNVIDIA128,000Llama 3.1 Nemotron 70B Instruct
nvidia/nemotron-nano-9b-v2NVIDIA128,000Nemotron Nano 9B V2
nvidia/nemotron-nano-12b-v2-vlNVIDIA128,000Nemotron Nano 12B V2 VL
perplexity/sonarPerplexity128,000Sonar
perplexity/sonar-proPerplexity200,000Sonar Pro
x-ai/grok-3-betaxAI131,000Grok 3 Beta
x-ai/grok-3-mini-betaxAI131,000Grok 3 Beta Mini
x-ai/grok-4-07-09xAI256,000Grok 4
x-ai/grok-code-fast-1xAI256,000Grok Code Fast 1
x-ai/grok-4-fast-non-reasoningxAI2,000,000Grok 4 Fast
x-ai/grok-4-fast-reasoningxAI2,000,000Grok 4 Fast Reasoning
x-ai/grok-4-1-fast-non-reasoningxAI2,000,000Grok 4.1 Fast Non-Reasoning
x-ai/grok-4-1-fast-reasoningxAI2,000,000Grok 4.1 Fast Reasoning
x-ai/grok-4-20-0309-non-reasoningxAI2,000,000Coming Soon
x-ai/grok-4-20-0309-reasoningxAI2,000,000Coming Soon
zhipu/glm-4.5-airZhipu128,000GLM-4.5 Air
zhipu/glm-4.5Zhipu128,000GLM-4.5
zhipu/glm-4.6Zhipu200,000GLM-4.6
zhipu/glm-4.7Zhipu200,000GLM-4.7
zhipu/glm-5Zhipu200,000GLM-5
zhipu/glm-5-1Zhipu200,000Coming Soon