30 Model API endpoints

OpenAI-Compatible AI API Documentation

Integrate multiple AI models through one gateway using familiar SDKs, one Base URL, and one API Key.

Connect a coding agent with one command

Copy one terminal command to test Codex, Claude Code, Gemini CLI, or Cursor through CostRouter. Save the persistent setup only after the connection works.

Open tutorial

API Reference

After your first successful request, use this section to review provider-specific request parameters and response formats.

30 Model API endpoints
GETOpenAIOpenAI/models

List Models

Lists currently available OpenAI-style models. CostRouter can also route Anthropic and Gemini model-list requests by headers.

Recommended first step

Make your first request with curl

Replace sk-xxxx with your full API Key, then copy and paste the entire block into a macOS or Linux terminal. Once you receive a normal response, continue with the code, SDK, or client settings below. Keep each trailing backslash in place with no spaces after it.

curl Example

curl -X GET \
  "https://costrouter.ai/v1/models" \
  -H "Authorization: Bearer sk-xxxx"

After the test: Configure your integration

Choose the option that matches your request tool, code, SDK, or third-party client, then use the request details below to complete the integration.

I'm configuring a request in a tool or code

Open the request's Headers settings and add an item: enter the header name below on the left and its value on the right.

Enter the header name
Authorization
Enter the header value
Bearer sk-xxxx
I'm entering a key in an app or SDK

Find the app's API Key, Token, or Secret field and paste your full key, such as sk-xxxx. Do not include Authorization or Bearer.

Paste into the API Key / Token field
sk-xxxx
Content Type
N/A
Model Examples
gpt-5.6-luna, gpt-5.6-terra, gpt-5.6-sol, gpt-5.4-mini, gpt-image-2

Response Example

{
  "object": "list",
  "data": [
    {
      "id": "gpt-5.6-luna",
      "object": "model",
      "owned_by": "openai"
    }
  ]
}
Parameters
NameTypeRequiredDescription
No parameters are required.
Response Example
NameTypeRequiredDescription
dataarray<object>NoResult array or provider response data.

Common errors and fixes

Most first-request failures involve authentication, model IDs, account balance or spend limits, or invalid request parameters.

401

Authentication failed

For raw HTTP, check the authentication header and full key. In an SDK's API Key field, enter only sk-xxxx—not Bearer sk-xxxx.

403

Access or balance issue

Check key status, account balance, model access, and billing settings.

429

Rate limited

Reduce concurrency, retry with backoff, or review account limits.

5xx

Provider or routing failure

Retry later, then inspect Usage Logs for the request status and selected model route.

Copyright 2026 CostRouter. All rights reserved.

CostRouter is prohibited for users located in mainland China. If use from mainland China is discovered, CostRouter may suspend or terminate the account, and any paid fees or remaining balance will not be refunded.

Contact us

Choose the channel that best matches your request.

Contact us
OpenAI-Compatible API Documentation | CostRouter