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)
      • 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 Opus
        • Claude 3 Sonnet
        • Claude 3.5 Haiku
        • Claude 3.5 Sonnet
        • Claude 3.7 Sonnet
        • Claude 4 Opus
        • Claude 4 Sonnet
      • Cohere
        • command-r-plus
      • DeepSeek
        • DeepSeek V3
        • DeepSeek R1
        • DeepSeek Prover V2
      • Google
        • gemini-1.5-flash
        • gemini-1.5-pro
        • gemini-2.0-flash-exp
        • gemini-2.0-flash
        • gemini-2.5-flash-preview
        • gemini-2.5-pro-exp
        • gemini-2.5-pro-preview
        • gemma-2
        • gemma-3
        • gemma-3n-4b
      • 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
        • 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
        • flux/kontext-max/text-to-image
        • flux/kontext-max/image-to-image
        • flux/kontext-pro/text-to-image
        • flux/kontext-pro/image-to-image
      • Google
        • Imagen 3
        • Imagen 4 Preview
      • OpenAI
        • DALL·E 2
        • DALL·E 3
        • gpt-image-1
      • 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)
        • Veo3 (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
        • hailuo-02
      • Runway
        • gen3a_turbo
        • gen4_turbo
    • Music Models
      • Google
        • Lyria 2
      • 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
    • Find Relevant Answers: Semantic Search with Text Embeddings
    • 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
    • Cline
    • Langflow
    • LiteLLM
    • Roo Code
Powered by GitBook
On this page

Was this helpful?

  1. API REFERENCES

Text Models (LLM)

PreviousAll Model IDsNextAlibaba Cloud

Last updated 8 days 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 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.

If you need a more detailed explanation of how to call a model's API in code, check out our QUICKSTART 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 + API Reference link
Developer
Context
Model Card

Open AI

16,000

Open AI

16,000

Open AI

16,000

Open AI

128,000

Open AI

128,000

Open AI

128,000

Open AI

128,000

Open AI

128,000

-

Open AI

128,000

-

Open AI

128,000

Open AI

128,000

Open AI

128,000

Open AI

128,000

Open AI

128,000

Open AI

128,000

-

Open AI

8,000

Open AI

8,000

-

Open AI

8,000

-

Open AI

128,000

Open AI

128,000

-

Open AI

128,000

Open AI

128,000

-

Open AI

200,000

Open AI

200,000

oming soon

Open AI

200,000

Open AI

128,000

Open AI

1,000,000

Open AI

1,000,000

Open AI

1,000,000

Open AI

200,000

DeepSeek

128,000

DeepSeek

128,000

DeepSeek

164,000

Meta

131,000

Google

8,000

Meta

128,000

-

Mistral AI

64,000

Alibaba Cloud

32,000

Mistral AI

64,000

Nvidia

128,000

NousResearch

32,000

-

Meta

128,000

Meta

131,000

Meta

131,000

Alibaba Cloud

32,000

Alibaba Cloud

131,000

-

Meta

9,000

Meta

8,000

Meta

8,000

Meta

4,000

Meta

128,000

Meta

128,000

Meta

256,000

Meta

256,000

Mistral AI

32,000

Mistral AI

8,000

Mistral AI

32,000

Gryphe

4,000

-

Anthropic

200,000

Anthropic

200,000

-

Anthropic

200,000

-

Anthropic

200,000

Anthropic

200,000

-

Anthropic

200,000

Anthropic

200,000

Anthropic

200,000

Google

1,000,000

Google

1,000,000

Google

1,000,000

Google

1,000,000

Google

1,000,000

-

or

Google

1,000,000

Google

1,000,000

Google

8,192

Coming soon

Alibaba Cloud

32,000

Alibaba Cloud

131,000

Alibaba Cloud

1,000,000

Alibaba Cloud

32,000

Alibaba Cloud

32,000

Alibaba Cloud

131,000

Alibaba Cloud

32000

Mistral AI

32,000

xAI

131,000

xAI

131,000

xAI

131,000

Mistral AI

128,000

Open Source

8,000

Anthracite

32,000

Nvidia

128,000

Cohere

128,000

Mistral AI

256,000

Minimax AI

1,000,000

Minimax AI

245,000

-

✅
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
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
o1-preview
OpenAI o1-preview
o1-preview-2024-09-12
o1-mini
OpenAI o1-mini
o1-mini-2024-09-12
o1
OpenAI o1
openai/o3-2025-04-16
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-chat or deepseek/deepseek-chat or deepseek/deepseek-chat-v3-0324
DeepSeek V3
deepseek/deepseek-r1 or deepseek-reasoner
DeepSeek R1
deepseek/deepseek-prover-v2
DeepSeek Prover V2
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
Llama 4 Scout
meta-llama/llama-4-maverick
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
anthropic/claude-opus-4
Claude 4 Opus
anthropic/claude-sonnet-4
Claude 4 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
gemini-2.0-flash
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
Gemini Pro 2.5 Preview
google/gemini-2.5-flash-preview
Gemini 2.5 Flash Preview
google/gemma-3n-e4b-it
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
Qwen 3 235B A22B
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+
mistralai/codestral-2501
Mistral Codestral-2501
MiniMax-Text-01
MiniMax-Text-01
abab6.5s-chat