AI/ML API Documentation
API KeyModelsPlaygroundGitHubGet Support
  • 📞Contact Sales
  • 🗯️Send Feedback
  • Quickstart
    • 🧭Documentation Map
    • Setting Up
    • Supported SDKs
  • API REFERENCES
    • 📒All Model IDs
    • Text Models (LLM)
      • AI21 Labs
        • jamba-1-5-mini
      • Alibaba Cloud
        • qwen-max
        • qwen-plus
        • qwen-turbo
        • Qwen2-72B-Instruct
        • Qwen2.5-7B-Instruct-Turbo
        • Qwen2.5-72B-Instruct-Turbo
        • Qwen2.5-Coder-32B-Instruct
        • Qwen-QwQ-32B
        • Qwen3-235B-A22B
      • Anthracite
        • magnum-v4
      • Anthropic
        • Claude 3 Haiku
        • Claude 3.5 Haiku
        • Claude 3 Opus
        • Claude 3 Sonnet
        • Claude 3.5 Sonnet
        • Claude 3.7 Sonnet
      • Cohere
        • command-r-plus
      • DeepSeek
        • DeepSeek V3
        • DeepSeek R1
      • Google
        • gemini-1.5-flash
        • gemini-1.5-pro
        • gemini-2.0-flash-exp
        • gemini-2.0-flash-thinking-exp-01-21
        • gemini-2.0-flash
        • gemini-2.5-flash-preview
        • gemini-2.5-pro-exp
        • gemini-2.5-pro-preview
        • gemma-2
        • gemma-3
      • Gryphe
        • MythoMax-L2-13b-Lite
      • Meta
        • Llama-3-chat-hf
        • Llama-3-8B-Instruct-Lite
        • Llama-3.1-8B-Instruct-Turbo
        • Llama-3.1-70B-Instruct-Turbo
        • Llama-3.1-405B-Instruct-Turbo
        • Llama-3.2-11B-Vision-Instruct-Turbo
        • Llama-3.2-90B-Vision-Instruct-Turbo
        • Llama-Vision-Free
        • Llama-3.2-3B-Instruct-Turbo
        • Llama-3.3-70B-Instruct-Turbo
        • Llama-4-scout
        • Llama-4-maverick
      • MiniMax
        • text-01
        • abab6.5s-chat
      • Mistral AI
        • codestral-2501
        • mistral-nemo
        • mistral-tiny
        • Mistral-7B-Instruct
        • Mixtral-8x22B-Instruct
        • Mixtral-8x7B-Instruct
      • NVIDIA
        • Llama-3.1-Nemotron-70B-Instruct-HF
        • llama-3.1-nemotron-70b
      • NeverSleep
        • llama-3.1-lumimaid
      • NousResearch
        • Nous-Hermes-2-Mixtral-8x7B-DPO
      • OpenAI
        • gpt-3.5-turbo
        • gpt-4
        • gpt-4-preview
        • gpt-4-turbo
        • gpt-4o
        • gpt-4o-mini
        • gpt-4o-audio-preview
        • gpt-4o-mini-audio-preview
        • gpt-4o-search-preview
        • gpt-4o-mini-search-preview
        • o1
        • o1-mini
        • o1-preview
        • o3-mini
        • gpt-4.5-preview
        • gpt-4.1
        • gpt-4.1-mini
        • gpt-4.1-nano
        • o4-mini
      • xAI
        • grok-beta
        • grok-3-beta
        • grok-3-mini-beta
    • Image Models
      • Flux
        • flux-pro
        • flux-pro/v1.1
        • flux-pro/v1.1-ultra
        • flux-realism
        • flux/dev
        • flux/dev/image-to-image
        • flux/schnell
      • Google
        • Imagen 3.0
      • OpenAI
        • DALL·E 2
        • DALL·E 3
      • RecraftAI
        • Recraft v3
      • Stability AI
        • Stable Diffusion v3 Medium
        • Stable Diffusion v3.5 Large
    • Video Models
      • Alibaba Cloud
        • Wan 2.1 (Text-to-Video)
      • Google
        • Veo2 (Image-to-Video)
        • Veo2 (Text-to-Video)
      • Kling AI
        • v1-standard/image-to-video
        • v1-standard/text-to-video
        • v1-pro/image-to-video
        • v1-pro/text-to-video
        • v1.6-standard/text-to-video
        • v1.6-standard/image-to-video
        • v1.6-pro/image-to-video
        • v1.6-pro/text-to-video
        • v1.6-standard/effects
        • v1.6-pro/effects
        • v2-master/image-to-video
        • v2-master/text-to-video
      • Luma AI
        • Text-to-Video v2
        • Text-to-Video v1 (legacy)
      • MiniMax
        • video-01
        • video-01-live2d
      • Runway
        • gen3a_turbo
        • gen4_turbo
    • Music Models
      • MiniMax
        • minimax-music [legacy]
        • music-01
      • Stability AI
        • stable-audio
    • Voice/Speech Models
      • Speech-to-Text
        • stt [legacy]
        • Deepgram
          • nova-2
        • OpenAI
          • whisper-base
          • whisper-large
          • whisper-medium
          • whisper-small
          • whisper-tiny
      • Text-to-Speech
        • Deepgram
          • aura
    • Content Moderation Models
      • Meta
        • Llama-Guard-3-11B-Vision-Turbo
        • LlamaGuard-2-8b
        • Meta-Llama-Guard-3-8B
    • 3D-Generating Models
      • Stability AI
        • triposr
    • Vision Models
      • Image Analysis
      • OCR: Optical Character Recognition
        • Google
          • Google OCR
        • Mistral AI
          • mistral-ocr-latest
      • OFR: Optical Feature Recognition
    • Embedding Models
      • Anthropic
        • voyage-2
        • voyage-code-2
        • voyage-finance-2
        • voyage-large-2
        • voyage-large-2-instruct
        • voyage-law-2
        • voyage-multilingual-2
      • BAAI
        • bge-base-en
        • bge-large-en
      • Google
        • textembedding-gecko
        • text-multilingual-embedding-002
      • OpenAI
        • text-embedding-3-large
        • text-embedding-3-small
        • text-embedding-ada-002
      • Together AI
        • m2-bert-80M-retrieval
  • Solutions
    • Bagoodex
      • AI Search Engine
        • Find Links
        • Find Images
        • Find Videos
        • Find the Weather
        • Find a Local Map
        • Get a Knowledge Structure
    • OpenAI
      • Assistants
        • Assistant API
        • Thread API
        • Message API
        • Run and Run Step API
        • Events
  • Use Cases
    • Create Images: Illustrate an Article
    • Animate Images: A Children’s Encyclopedia
    • Create an Assistant to Discuss a Specific Document
    • Create a 3D Model from an Image
    • Create a Looped GIF for a Web Banner
    • Read Text Aloud and Describe Images: Support People with Visual Impairments
    • Summarize Websites with AI-Powered Chrome Extension
  • Capabilities
    • Completion and Chat Completion
    • Streaming Mode
    • Code Generation
    • Thinking / Reasoning
    • Function Calling
    • Vision in Text Models (Image-To-Text)
    • Web Search
    • Features of Anthropic Models
    • Model comparison
  • FAQ
    • Can I use API in Python?
    • Can I use API in NodeJS?
    • What are the Pro Models?
    • How to use the Free Tier?
    • Are my requests cropped?
    • Can I call API in the asynchronous mode?
    • OpenAI SDK doesn't work?
  • Errors and Messages
    • General Info
    • Errors with status code 4xx
    • Errors with status code 5xx
  • Glossary
    • Concepts
  • Integrations
    • 🧩Our Integration List
    • Langflow
    • LiteLLM
Powered by GitBook
On this page

Was this helpful?

  1. API REFERENCES

Text Models (LLM)

PreviousAll Model IDsNextAI21 Labs

Last updated 1 day ago

Was this helpful?

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 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 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 article.

Endpoint

All text and chat models use the same endpoint:

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: .

Quick Code Example

We will call the model using the Python programming language and the OpenAI SDK.

If you need a more detailed explanation of how to call a model's API in code, check out our section.

%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}")

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

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.
Complete Text Model List
Model ID
Developer
Context
Model Card

Open AI

128000

Open AI

128000

Open AI

128000

Open AI

128000

Open AI

128000

-

Open AI

128000

-

Open AI

128000

Open AI

128000

Open AI

128000

Open AI

128000

Open AI

128000

Open AI

128000

-

Open AI

8000

Open AI

8000

-

Open AI

8000

-

Open AI

16000

Open AI

16000

Open AI

16000

Open AI

200000

Open AI

128000

Open AI

128000

-

Open AI

128000

Open AI

128000

-

Open AI

200000

Open AI

128000

Open AI

1000000

Open AI

1000000

Open AI

1000000

Open AI

200000

DeepSeek

128000

DeepSeek

128000

Meta

131000

Google

8000

Meta

128000

-

Mistral AI

64000

Alibaba Cloud

32000

Mistral AI

64000

Nvidia

128000

NousResearch

32000

-

Meta

128000

Meta

131000

Meta

131000

Alibaba Cloud

32000

Alibaba Cloud

131000

-

Meta

9000

Meta

8000

Meta

8000

Meta

4000

Meta

128000

Meta

128000

Meta

256000

Coming soon

Meta

256000

Coming soon

Mistral AI

32000

Mistral AI

8000

Mistral AI

32000

Gryphe

4000

-

Anthropic

200000

Anthropic

200000

-

Anthropic

200000

-

Anthropic

200000

Anthropic

200000

-

Anthropic

200000

Google

1000000

Google

1000000

Google

1000000

Google

1000000

Google

1000000

Coming soon

Google

1000000

Coming soon

or

Google

1000000

Coming soon

Google

1000000

Coming soon

Alibaba Cloud

32000

Alibaba Cloud

131000

Alibaba Cloud

1000000

Alibaba Cloud

32000

Alibaba Cloud

32000

Alibaba Cloud

131000

Alibaba Cloud

32000

Coming Soon

Mistral AI

32000

xAI

131000

xAI

131000

xAI

131000

Mistral AI

128000

Open Source

8000

Anthracite

32000

Nvidia

128000

Cohere

128000

AI21 Labs

256000

Mistral AI

256000

Minimax AI

1000000

Minimax AI

245000

-

✅
Completion and Chat Completion
Managing Assistants & Threads
Function Calling
https://api.aimlapi.com/v1/chat/completions
gpt-4o
QUICKSTART
gpt-4o
Chat GPT-4o
gpt-4o-2024-08-06
GPT-4o-2024-08-06
gpt-4o-2024-05-13
GPT-4o-2024-05-13
gpt-4o-mini
Chat GPT 4o mini
gpt-4o-mini-2024-07-18
chatgpt-4o-latest
gpt-4o-audio-preview
GPT-4o Audio Preview
gpt-4o-mini-audio-preview
GPT-4o mini Audio
gpt-4o-search-preview
GPT-4o Search Preview
gpt-4o-mini-search-preview
GPT-4o Mini Search Preview
gpt-4-turbo
Chat GPT 4 Turbo
gpt-4-turbo-2024-04-09
gpt-4
Chat GPT 4
gpt-4-0125-preview
gpt-4-1106-preview
gpt-3.5-turbo
Chat GPT 3.5 Turbo
gpt-3.5-turbo-0125
Chat GPT-3.5 Turbo 0125
gpt-3.5-turbo-1106
Chat GPT-3.5 Turbo 1106
o1
OpenAI o1
o1-preview
OpenAI o1-preview
o1-preview-2024-09-12
o1-mini
OpenAI o1-mini
o1-mini-2024-09-12
o3-mini
OpenAI o3 mini
gpt-4.5-preview
Chat GPT 4.5 preview
openai/gpt-4.1-2025-04-14
GPT-4.1
openai/gpt-4.1-mini-2025-04-14
GPT-4.1 Mini
openai/gpt-4.1-nano-2025-04-14
GPT-4.1 Nano
openai/o4-mini-2025-04-16
GPT-o4-mini-2025-04-16
DeepSeek V3
DeepSeek V3
DeepSeek R1
DeepSeek R1
meta-llama/Llama-3.2-90B-Vision-Instruct-Turbo
Llama 3.2 90B Vision Instruct Turbo
google/gemma-2-27b-it
Gemma 2 (27b)
meta-llama/Llama-Vision-Free
mistralai/Mixtral-8x22B-Instruct-v0.1
Mixtral 8x22B Instruct
Qwen/Qwen2-72B-Instruct
Qwen 2 Instruct (72B)
mistralai/Mixtral-8x7B-Instruct-v0.1
Mixtral-8x7B Instruct v0.1
nvidia/Llama-3.1-Nemotron-70B-Instruct-HF
Llama 3.1 Nemotron 70B Instruct
NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO
meta-llama/Llama-3.3-70B-Instruct-Turbo
Meta Llama 3.3 70B Instruct Turbo
meta-llama/Llama-3.2-3B-Instruct-Turbo
Llama 3.2 3B Instruct Turbo
meta-llama/Llama-3.2-11B-Vision-Instruct-Turbo
Llama 3.2 11B Vision Instruct Turbo
Qwen/Qwen2.5-7B-Instruct-Turbo
Qwen 2.5 7B Instruct Turbo
Qwen/Qwen2.5-Coder-32B-Instruct
meta-llama/Meta-Llama-3-8B-Instruct-Lite
Llama 3 8B Instruct Lite
meta-llama/Llama-3-8b-chat-hf
Llama 3 8B Instruct Reference
meta-llama/Llama-3-70b-chat-hf
Llama 3 70B Instruct Reference
meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo
Llama 3.1 (405B) Instruct Turbo
meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo
Llama 3.1 8B Instruct Turbo
meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo
Llama 3.1 70B Instruct Turbo
meta-llama/llama-4-scout
meta-llama/llama-4-maverick
mistralai/Mistral-7B-Instruct-v0.2
Mistral (7B) Instruct v0.2
mistralai/Mistral-7B-Instruct-v0.1
Mistral (7B) Instruct v0.1
mistralai/Mistral-7B-Instruct-v0.3
Mistral (7B) Instruct v0.3
Gryphe/MythoMax-L2-13b-Lite
claude-3-opus-20240229
Claude 3 Opus
claude-3-haiku-20240307
claude-3-5-sonnet-20240620
claude-3-5-sonnet-20241022
Claude 3.5 Sonnet 20241022
claude-3-5-haiku-20241022
claude-3-7-sonnet-20250219
Claude 3.7 Sonnet
gemini-1.5-flash
Gemini 1.5 Flash
gemini-1.5-pro
Gemini 1.5 Pro
gemini-2.0-flash-exp
Gemini 2.0 Flash Experimental
google/gemini-2.0-flash-thinking-exp-01-21
Gemini 2.0 Flash Thinking Experimental
gemini-2.0-flash
gemini-2.5-pro-exp-03-25
google/gemini-2.5-pro-preview
google/gemini-2.5-pro-preview-05-06
google/gemini-2.5-flash-preview
qwen-max
Qwen Max
qwen-plus
Qwen Plus
qwen-turbo
Qwen Turbo
qwen-max-2025-01-25
Qwen Max 2025-01-25
Qwen/Qwen2.5-72B-Instruct-Turbo
Qwen 2.5 72B Instruct Turbo
Qwen/QwQ-32B
QwQ-32B
Qwen/Qwen3-235B-A22B-fp8-tput
mistralai/mistral-tiny
Mistral Tiny
x-ai/grok-beta
Grok-2 Beta
x-ai/grok-3-beta
Grok 3 Beta
x-ai/grok-3-mini-beta
Grok 3 Beta Mini
mistralai/mistral-nemo
Mistral Nemo
neversleep/llama-3.1-lumimaid-70b
Llama 3.1 Lumimaid 70b
anthracite-org/magnum-v4-72b
Magnum v4 72B
nvidia/llama-3.1-nemotron-70b-instruct
Llama 3.1 Nemotron 70B Instruct
cohere/command-r-plus
Command R+
ai21/jamba-1-5-mini
Jamba 1.5 Mini
mistralai/codestral-2501
Mistral Codestral-2501
MiniMax-Text-01
MiniMax-Text-01
abab6.5s-chat
o4-mini