Skip to main content
ModelsLab’s LLM API gives you access to 200+ large language models through a single, unified API. It’s fully compatible with both OpenAI and Anthropic SDKs, so you can use tools like Claude Code, ChatGPT-compatible clients, and any OpenAI/Anthropic SDK with minimal configuration changes.

Base URL

https://modelslab.com/api/v7/llm

Authentication

All endpoints use Bearer token authentication. Pass your ModelsLab API key in the Authorization header:
Authorization: Bearer YOUR_MODELSLAB_API_KEY

Endpoints

Chat Completions

OpenAI-compatible chat completions endpoint. Works with OpenAI SDKs, LangChain, and any OpenAI-compatible client.

Messages

Anthropic-compatible messages endpoint. Works with the Anthropic SDK, Claude Code, and any Anthropic-compatible client.

Function Calling

Enable models to call functions and tools. Supports both OpenAI and Anthropic tool use formats.

Advanced Parameters

Detailed reference for sampling, penalties, streaming, response formatting, and more.

Count Tokens

Count the number of tokens in a message before sending it. Useful for managing costs and context windows.

List Models

Retrieve the list of all available LLM models and their capabilities.

Coding Tools Integration

Use ModelsLab with Claude Code, Codex, Cursor, Continue, Aider, and other AI coding assistants.

SDK Compatibility

ModelsLab’s LLM API is designed as a drop-in replacement for both OpenAI and Anthropic APIs. Just change the base URL and API key:
from openai import OpenAI

client = OpenAI(
    api_key="YOUR_MODELSLAB_API_KEY",
    base_url="https://modelslab.com/api/v7/llm",
)

response = client.chat.completions.create(
    model="Qwen/Qwen2.5-VL-72B-Instruct-together",
    messages=[
        {"role": "user", "content": "Hello!"}
    ],
)

print(response.choices[0].message.content)

Supported Models

Browse all available LLM models at modelslab.com/models/category/llmaster, or use the List Models endpoint to fetch them programmatically. Popular models include:
  • Qwen 2.5 VL 72B — Vision-language model with strong reasoning
  • DeepSeek R1 — Advanced reasoning model
  • Llama 3.1 70B/405B — Meta’s open-source flagship models
  • Mistral Large — Mistral AI’s most capable model
  • And 200+ more…