### Conductor Environment Variable Setup Source: https://openlimits.app/docs Set these environment variables to force Conductor to use the Openlimits API if Claude Code CLI is not installed. ```shell ANTHROPIC_BASE_URL=https://openlimits.app ANTHROPIC_API_KEY=your-key-here ``` -------------------------------- ### POST /v1/chat/completions Response Example Source: https://openlimits.app/docs This is an example of a successful JSON response from the /v1/chat/completions endpoint, following the OpenAI chat completion format. It includes details about the conversation, model used, and token usage. ```json { "id": "chatcmpl-...", "object": "chat.completion", "created": 1700000000, "model": "anthropic/claude-opus-4.8", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Hello! How can I help?" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 20, "completion_tokens": 8, "total_tokens": 28 } } ``` -------------------------------- ### Python Anthropic SDK Example Source: https://openlimits.app/docs Use the Anthropic Python SDK to interact with the Openlimits API. Ensure you have the SDK installed and your API key and base URL are configured. ```python import anthropic client = anthropic.Anthropic( api_key="your-key-here", base_url="https://openlimits.app", ) message = client.messages.create( model="anthropic/claude-opus-4.8", max_tokens=1024, messages=[{"role": "user", "content": "Hello"}], ) print(message.content[0].text) ``` -------------------------------- ### List Available Models Source: https://openlimits.app/docs Use this GET request to retrieve a list of all available models. Include your API key in the 'x-api-key' header. ```http GET /v1/models x-api-key: YOUR_KEY ``` ```json { "object": "list", "data": [ { "id": "anthropic/claude-opus-4.8", "object": "model", "owned_by": "anthropic" }, { "id": "anthropic/claude-opus-4.7", "object": "model", "owned_by": "anthropic" }, { "id": "anthropic/claude-sonnet-5", "object": "model", "owned_by": "anthropic" }, { "id": "anthropic/claude-haiku-4.5", "object": "model", "owned_by": "anthropic" }, { "id": "anthropic/fable-5", "object": "model", "owned_by": "anthropic" }, { "id": "openai/gpt-5.6-sol", "object": "model", "owned_by": "openai" }, { "id": "openai/gpt-5.6-terra", "object": "model", "owned_by": "openai" }, { "id": "openai/gpt-5.6-luna", "object": "model", "owned_by": "openai" }, { "id": "openai/gpt-5.5", "object": "model", "owned_by": "openai" }, { "id": "openai/gpt-5.4", "object": "model", "owned_by": "openai" }, { "id": "openai/gpt-5.4-mini", "object": "model", "owned_by": "openai" }, { "id": "openai/gpt-5.3-codex-spark", "object": "model", "owned_by": "openai" }, { "id": "z-ai/glm-5.2", "object": "model", "owned_by": "zai" }, { "id": "z-ai/glm-5.1", "object": "model", "owned_by": "zai" }, { "id": "z-ai/glm-5-turbo", "object": "model", "owned_by": "zai" }, { "id": "minimax/minimax-m3", "object": "model", "owned_by": "minimax" }, { "id": "deepseek/deepseek-v4-pro", "object": "model", "owned_by": "deepseek" }, { "id": "deepseek/deepseek-v4-flash", "object": "model", "owned_by": "deepseek" } ] } ``` -------------------------------- ### Python OpenAI SDK Example Source: https://openlimits.app/docs Use the OpenAI Python SDK to interact with the Openlimits API. Configure the client with your API key and the Openlimits base URL. ```python from openai import OpenAI client = OpenAI( api_key="your-key-here", base_url="https://openlimits.app/v1", ) response = client.chat.completions.create( model="anthropic/claude-opus-4.8", messages=[{"role": "user", "content": "Hello"}], ) print(response.choices[0].message.content) ``` -------------------------------- ### Set Environment Variables for Anthropic Source: https://openlimits.app/docs Configure your environment by setting the ANTHROPIC_BASE_URL and ANTHROPIC_API_KEY. This is the only setup required for Anthropic-compatible clients to route through OpenLimits. ```bash export ANTHROPIC_BASE_URL=https://openlimits.app export ANTHROPIC_API_KEY=your-key-here ``` -------------------------------- ### POST /v1/responses Request Example Source: https://openlimits.app/docs This snippet shows how to make a POST request to the /v1/responses endpoint to get a streamed response from an OpenAI or Fable model. Ensure you have a valid API key and specify the desired model and input. ```http POST /v1/responses Content-Type: application/json Authorization: Bearer YOUR_KEY { "model": "openai/gpt-5.5", "instructions": "You are a helpful assistant.", "input": "Explain recursion in one sentence.", "stream": true, "store": false } ``` -------------------------------- ### POST /v1/messages Request Example Source: https://openlimits.app/docs This example demonstrates a direct proxy request to the Anthropic Messages API using the /v1/messages endpoint. The request format is identical to Anthropic's. ```http POST /v1/messages Content-Type: application/json x-api-key: YOUR_KEY { "model": "anthropic/claude-opus-4.8", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Explain recursion in one sentence." } ], "stream": false } ``` -------------------------------- ### cURL Request Example Source: https://openlimits.app/docs Make a direct API request using cURL to the Openlimits messages endpoint. Ensure you include the correct API key and content type headers. ```shell curl https://openlimits.app/v1/messages \ -H "x-api-key: your-key-here" \ -H "content-type: application/json" \ -d '{ "model": "anthropic/claude-opus-4.8", "max_tokens": 1024, "messages": [{"role": "user", "content": "Hello"}] }' ``` -------------------------------- ### Automated Claude Code CLI Setup Source: https://openlimits.app/docs Run this script to automatically configure Claude Code and Codex CLI. Alternatively, manually add settings to ~/.claude/settings.json. ```shell curl -fsSL "https://openlimits.app/setup?token=your-key-here" | bash ``` ```json { "env": { "ANTHROPIC_BASE_URL": "https://openlimits.app", "ANTHROPIC_AUTH_TOKEN": "your-key-here" } } ``` -------------------------------- ### Anthropic Error Format Example Source: https://openlimits.app/docs This is an example of the error response format used by Anthropic models. ```json { "type": "error", "error": { "type": "authentication_error", "message": "Invalid or disabled authentication token" } } ``` -------------------------------- ### POST /v1/messages Response Example Source: https://openlimits.app/docs A typical response from the /v1/messages endpoint, mirroring the Anthropic Messages API response format. ```json { "id": "msg_...", "type": "message", "role": "assistant", "content": [ { "type": "text", "text": "Recursion is when a function calls itself..." } ], "model": "anthropic/claude-opus-4.8", "usage": { "input_tokens": 14, "output_tokens": 32, "cache_read_input_tokens": 0, "cache_creation_input_tokens": 0 } } ``` -------------------------------- ### TypeScript Anthropic SDK Example Source: https://openlimits.app/docs Use the Anthropic TypeScript SDK to interact with the Openlimits API. Set your API key and the base URL for the client. ```typescript import Anthropic from "@anthropic-ai/sdk"; const client = new Anthropic({ apiKey: "your-key-here", baseURL: "https://openlimits.app", }); const message = await client.messages.create({ model: "anthropic/claude-opus-4.8", max_tokens: 1024, messages: [{ role: "user", content: "Hello" }], }); console.log(message.content[0].text) ``` -------------------------------- ### POST /v1/chat/completions Request Example Source: https://openlimits.app/docs This snippet demonstrates a POST request to the /v1/chat/completions endpoint, which is compatible with OpenAI SDK clients. It translates requests to the Anthropic API on the fly. Include your API key, model, messages, and desired stream setting. ```http POST /v1/chat/completions Content-Type: application/json Authorization: Bearer YOUR_KEY { "model": "anthropic/claude-opus-4.8", "messages": [ { "role": "system", "content": "You are a helpful assistant." }, { "role": "user", "content": "Hello" } ], "max_tokens": 1024, "stream": false } ``` -------------------------------- ### GET /v1/models Source: https://openlimits.app/docs Returns a list of all available models in OpenAI-compatible format. This endpoint is useful for discovering which models are available for use through the API. ```APIDOC ## GET /v1/models ### Description Returns a list of all available models in OpenAI-compatible format. ### Method GET ### Endpoint /v1/models ### Headers - **x-api-key** (string) - Required - Your API key for authentication. ### Response #### Success Response (200) - **object** (string) - The type of the response object, expected to be "list". - **data** (array) - An array of model objects. - **id** (string) - The unique identifier for the model. - **object** (string) - The type of the object, expected to be "model". - **owned_by** (string) - The organization that owns the model. ### Response Example ```json { "object": "list", "data": [ { "id": "anthropic/claude-opus-4.8", "object": "model", "owned_by": "anthropic" }, { "id": "anthropic/claude-opus-4.7", "object": "model", "owned_by": "anthropic" }, { "id": "anthropic/claude-sonnet-5", "object": "model", "owned_by": "anthropic" }, { "id": "anthropic/claude-haiku-4.5", "object": "model", "owned_by": "anthropic" }, { "id": "anthropic/fable-5", "object": "model", "owned_by": "anthropic" }, { "id": "openai/gpt-5.6-sol", "object": "model", "owned_by": "openai" }, { "id": "openai/gpt-5.6-terra", "object": "model", "owned_by": "openai" }, { "id": "openai/gpt-5.6-luna", "object": "model", "owned_by": "openai" }, { "id": "openai/gpt-5.5", "object": "model", "owned_by": "openai" }, { "id": "openai/gpt-5.4", "object": "model", "owned_by": "openai" }, { "id": "openai/gpt-5.4-mini", "object": "model", "owned_by": "openai" }, { "id": "openai/gpt-5.3-codex-spark", "object": "model", "owned_by": "openai" }, { "id": "z-ai/glm-5.2", "object": "model", "owned_by": "zai" }, { "id": "z-ai/glm-5.1", "object": "model", "owned_by": "zai" }, { "id": "z-ai/glm-5-turbo", "object": "model", "owned_by": "zai" }, { "id": "minimax/minimax-m3", "object": "model", "owned_by": "minimax" }, { "id": "deepseek/deepseek-v4-pro", "object": "model", "owned_by": "deepseek" }, { "id": "deepseek/deepseek-v4-flash", "object": "model", "owned_by": "deepseek" } ] } ``` ``` -------------------------------- ### POST /v1/messages Streaming Request Example Source: https://openlimits.app/docs To enable streaming responses from the /v1/messages endpoint, set the 'stream' parameter to true. The event format follows the Anthropic streaming specification. ```json { "model": "anthropic/claude-opus-4.8", "max_tokens": 1024, "messages": [...], "stream": true } ``` -------------------------------- ### Configure OpenAI Clients with OpenLimits Source: https://openlimits.app/docs Set environment variables for OpenAI-compatible clients like Codex CLI/Desktop and OpenAI SDKs to use OpenLimits. The base URL includes '/v1'. ```bash # For Codex / OpenAI clients export OPENAI_BASE_URL=https://openlimits.app/v1 export OPENAI_API_KEY=your-key-here ``` -------------------------------- ### Configure Anthropic Clients with OpenLimits Source: https://openlimits.app/docs Set environment variables for Anthropic-compatible clients like Claude Code CLI and Conductor to use OpenLimits. Note the base URL does not include '/v1'. ```bash # For Claude Code / Anthropic clients export ANTHROPIC_BASE_URL=https://openlimits.app export ANTHROPIC_API_KEY=your-key-here ``` -------------------------------- ### Configure Codex CLI with OpenLimits Source: https://openlimits.app/docs Set up your Codex CLI to use OpenLimits as a model provider by editing the config.toml file. Ensure your API key is set as an environment variable. ```toml # ~/.codex/config.toml model = "openai/gpt-5.5" review_model = "openai/gpt-5.5" model_provider = "openlimits" [model_providers.openlimits] name = "OpenLimits" base_url = "https://openlimits.app/v1" env_key = "OPENAI_API_KEY" wire_api = "responses" ``` -------------------------------- ### Configure Codex CLI for GPT-5.6 Sol Source: https://openlimits.app/docs To use GPT-5.6 Sol, update the top-level model fields in your Codex CLI config.toml. The existing OpenLimits provider configuration should remain. ```toml model = "openai/gpt-5.6-sol" review_model = "openai/gpt-5.6-sol" model_provider = "openlimits" ``` -------------------------------- ### POST /v1/chat/completions Source: https://openlimits.app/docs An OpenAI-compatible endpoint that translates requests to the Anthropic API on the fly. Use this with any OpenAI SDK client. ```APIDOC ## POST /v1/chat/completions ### Description OpenAI-compatible endpoint. Send requests in the OpenAI format and we translate to Anthropic on the fly. Use this with any OpenAI SDK client. ### Method POST ### Endpoint /v1/chat/completions ### Parameters #### Request Body - **model** (string) - Required - The model to use (e.g., "anthropic/claude-opus-4.8"). - **messages** (array) - Required - An array of message objects, each with a `role` and `content`. - **role** (string) - Required - The role of the message sender (e.g., "system", "user", "assistant"). - **content** (string) - Required - The content of the message. - **max_tokens** (integer) - Optional - The maximum number of tokens to generate. - **stream** (boolean) - Optional - Whether to stream the response. Defaults to false. ### Request Example ```json { "model": "anthropic/claude-opus-4.8", "messages": [ { "role": "system", "content": "You are a helpful assistant." }, { "role": "user", "content": "Hello" } ], "max_tokens": 1024, "stream": false } ``` ### Response #### Success Response Returns a JSON object containing the chat completion details. #### Response Example ```json { "id": "chatcmpl-...", "object": "chat.completion", "created": 1700000000, "model": "anthropic/claude-opus-4.8", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Hello! How can I help?" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 20, "completion_tokens": 8, "total_tokens": 28 } } ``` ### Model Routing Claude model names are translated to the Anthropic Messages API format automatically. GPT models use OpenAI provider routes. Fable keeps its public Anthropic-compatible model ID while routing through OpenAI providers as a custom `gpt-5.5`-backed model. Model| Routes To ---|--- `anthropic/claude-opus-4.8`, `anthropic/claude-opus-4.7`, `anthropic/claude-sonnet-5`, `anthropic/claude-haiku-4.5`| Anthropic-compatible provider pool `anthropic/fable-5`| OpenAI provider pool as upstream `gpt-5.5`, with Anthropic-compatible responses on `/v1/messages` `minimax/minimax-m3`| MiniMax provider pool `z-ai/glm-5.2`, `z-ai/glm-5.1`, `z-ai/glm-5-turbo`, `deepseek/deepseek-v4-pro`, `deepseek/deepseek-v4-flash`| MiniMax fallback provider pool ``` -------------------------------- ### Set OpenAI API Key for Codex CLI Source: https://openlimits.app/docs Export your OpenAI API key to your shell profile to be used by Codex CLI when connecting to OpenLimits. ```bash export OPENAI_API_KEY=your-key-here ``` -------------------------------- ### POST /v1/responses Source: https://openlimits.app/docs Proxies requests to the OpenAI Responses API for GPT and Fable models. This endpoint is used by Codex CLI and Codex Desktop. ```APIDOC ## POST /v1/responses ### Description Proxies to the **OpenAI Responses API** for GPT and Fable models. This is the endpoint used by **Codex CLI** and **Codex Desktop** when configured with OpenLimits. ### Method POST ### Endpoint /v1/responses ### Parameters #### Request Body - **model** (string) - Required - The model to use (e.g., "openai/gpt-5.5"). - **instructions** (string) - Optional - Instructions for the model. - **input** (string) - Required - The input prompt for the model. - **stream** (boolean) - Required - Always true, as streaming is enabled by default. - **store** (boolean) - Required - Always false, as required by the upstream provider. ### Request Example ```json { "model": "openai/gpt-5.5", "instructions": "You are a helpful assistant.", "input": "Explain recursion in one sentence.", "stream": true, "store": false } ``` ### Response Returns a server-sent event (SSE) stream. Streaming is always enabled for this endpoint. The event format follows the OpenAI Responses API spec. ### Supported Models Use OpenRouter-style OpenAI model IDs, or `anthropic/fable-5` for Fable: * `anthropic/fable-5` * `openai/gpt-5.6-sol` * `openai/gpt-5.6-terra` * `openai/gpt-5.6-luna` * `openai/gpt-5.5` * `openai/gpt-5.4` * `openai/gpt-5.4-mini` * `openai/gpt-5.3-codex-spark` ``` -------------------------------- ### POST /v1/messages Effort Levels Configuration Source: https://openlimits.app/docs Control the trade-off between quality and speed for model responses using the 'effort' parameter within 'output_config'. Valid values include 'low', 'medium', 'high', 'extra', 'max', and 'ultracode'. ```json { "model": "anthropic/claude-opus-4.8", "max_tokens": 1024, "messages": [...], "output_config": { "effort": "low" } } ``` -------------------------------- ### GPT (OpenAI) Endpoints Source: https://openlimits.app/docs Endpoints for interacting with GPT models from OpenAI. Supports chat completions and responses. ```APIDOC ## GPT (OpenAI) ### Description Access GPT models via the `/v1/chat/completions` and `/v1/responses` endpoints. ### Models - `openai/gpt-5.6-sol` (GPT-5.6 Sol) - `openai/gpt-5.6-terra` (GPT-5.6 Terra) - `openai/gpt-5.6-luna` (GPT-5.6 Luna) - `openai/gpt-5.5` (GPT-5.5) - `openai/gpt-5.4` (GPT-5.4) - `openai/gpt-5.4-mini` (GPT-5.4 Mini) - `openai/gpt-5.3-codex-spark` (GPT-5.3 Codex Spark) ### Endpoints - `/v1/chat/completions` - `/v1/responses` ``` -------------------------------- ### Use OpenLimits Model in Codex CLI Source: https://openlimits.app/docs Specify the OpenLimits-compatible model ID when running commands in Codex CLI. ```bash codex --model openai/gpt-5.5 ``` -------------------------------- ### Authenticate API Requests Source: https://openlimits.app/docs API requests to OpenLimits require authentication using either the 'x-api-key' header (Anthropic style) or the 'Authorization: Bearer' header (OpenAI style). ```curl curl https://openlimits.app/v1/messages \ -H "x-api-key: YOUR_KEY" \ -H "content-type: application/json" \ -d '{"model":"anthropic/claude-opus-4.8","max_tokens":1024,"messages":[{"role":"user","content":"Hello"}]}' ``` -------------------------------- ### Claude (Anthropic) Endpoints Source: https://openlimits.app/docs Endpoints for interacting with Claude models from Anthropic. Supports both messages and chat completions. ```APIDOC ## Claude (Anthropic) ### Description Access Claude models via the `/v1/messages` and `/v1/chat/completions` endpoints. Fable 5 also supports `/v1/responses`. ### Models - `anthropic/claude-opus-4.8` (Opus 4.8) - `anthropic/claude-opus-4.7` (Opus 4.7) - `anthropic/claude-sonnet-5` (Sonnet 5) - `anthropic/claude-haiku-4.5` (Haiku 4.5) - `anthropic/fable-5` (Fable 5) ### Endpoints - `/v1/messages` - `/v1/chat/completions` - `/v1/responses` (for Fable 5) ``` -------------------------------- ### Open Model Groups Endpoints Source: https://openlimits.app/docs Endpoints for accessing open model groups using OpenRouter-style IDs. Available on plans with open model access. ```APIDOC ## Open Model Groups ### Description Access various open models using OpenRouter-style IDs. Available on plans that include open model access. ### Models - `z-ai/glm-5.2` (GLM 5.2) - `z-ai/glm-5.1` (GLM 5.1) - `z-ai/glm-5-turbo` (GLM 5 Turbo) - `minimax/minimax-m3` (MiniMax M3) - `deepseek/deepseek-v4-pro` (DeepSeek V4 Pro) - `deepseek/deepseek-v4-flash` (DeepSeek V4 Flash) ### Endpoints - `/v1/chat/completions` - `/v1/responses` ``` -------------------------------- ### Error Handling Source: https://openlimits.app/docs Details on the error formats and status codes used by the API, following the Anthropic error format. ```APIDOC ## Errors Errors follow the Anthropic error format: ```json { "type": "error", "error": { "type": "authentication_error", "message": "Invalid or disabled authentication token" } } ``` ### Status Codes - `400` (invalid_request_error): Invalid model or malformed request - `401` (authentication_error): Missing or invalid API key - `403` (permission_error): Spend limit exceeded or token expired - `429` (rate_limit_error): All providers temporarily at capacity ``` -------------------------------- ### POST /v1/messages Source: https://openlimits.app/docs Proxies requests directly to the Anthropic Messages API. Supports standard Anthropic request and response formats, streaming, effort level control, and extended thinking. ```APIDOC ## POST /v1/messages ### Description Proxies directly to the Anthropic Messages API. The request and response formats are identical — see Anthropic's docs for the full schema. ### Method POST ### Endpoint /v1/messages ### Request Body - **model** (string) - Required - The model to use for generation. - **max_tokens** (integer) - Required - The maximum number of tokens to generate. - **messages** (array) - Required - An array of message objects representing the conversation history. - **role** (string) - Required - The role of the message sender (e.g., "user", "assistant"). - **content** (string) - Required - The content of the message. - **stream** (boolean) - Optional - Whether to stream the response. - **output_config** (object) - Optional - Configuration for the output. - **effort** (string) - Optional - Controls quality vs speed. Valid values: `low`, `medium`, `high`, `extra`, `max`, `ultracode`. ### Request Example ```json { "model": "anthropic/claude-opus-4.8", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Explain recursion in one sentence." } ], "stream": false } ``` ### Response #### Success Response (200) - **id** (string) - Unique identifier for the message. - **type** (string) - Type of the response. - **role** (string) - Role of the sender (e.g., "assistant"). - **content** (array) - Content of the message. - **type** (string) - Type of content (e.g., "text"). - **text** (string) - The text content. - **model** (string) - The model used for generation. - **usage** (object) - Token usage information. - **input_tokens** (integer) - Number of input tokens. - **output_tokens** (integer) - Number of output tokens. - **cache_read_input_tokens** (integer) - Tokens read from cache. - **cache_creation_input_tokens** (integer) - Tokens used for cache creation. #### Response Example ```json { "id": "msg_...", "type": "message", "role": "assistant", "content": [ { "type": "text", "text": "Recursion is when a function calls itself..." } ], "model": "anthropic/claude-opus-4.8", "usage": { "input_tokens": 14, "output_tokens": 32, "cache_read_input_tokens": 0, "cache_creation_input_tokens": 0 } } ``` ### Streaming Set `"stream": true` to receive server-sent events (SSE). The event format follows the Anthropic streaming spec. ### Extended Thinking Supported via the `anthropic-beta: interleaved-thinking-2025-05-14` header. See Anthropic's extended thinking docs. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.