Bonus: Top up now and we'll double your first deposit — get x2 credits instantly.
One endpoint · many model families

OpenAI-compatible API

Keep the OpenAI SDK and request format. Point your client at LLM.API, use your LLM.API key, and switch between supported models by changing the model ID.

OpenAI Python and JavaScript SDKsStreaming responsesNo new client library
app.py
from openai import OpenAI

client = OpenAI(
    api_key="YOUR_LLM_API_KEY",
    base_url="https://api.llmapi.ai/v1",
)

response = client.chat.completions.create(
    model="claude-sonnet-5",
    messages=[{"role": "user", "content": "Hello"}],
)
Migration

Keep your SDK. Change the destination.

The request shape stays familiar. Replace the API key and base URL, then choose a model from the live catalogue.

Before · OpenAI directly

client = OpenAI( api_key=OPENAI_API_KEY )

After · LLM.API

client = OpenAI( api_key=LLM_API_KEY, base_url="https://api.llmapi.ai/v1" )
Provider prices, no markup

You pay the same per-token price the model provider charges.

Automatic fallback

If one provider route fails, requests can continue on another route for the same model.

Spend caps per key

Set a budget on each API key so one app or agent cannot overspend.

No data retention

Your prompts and responses are not stored after the request completes.

Coding tools

Use it in your IDE or agent

Any coding tool with an "OpenAI-compatible" provider option works. Paste these values into its settings.

ProviderOpenAI Compatible
Base URLhttps://api.llmapi.ai/v1
API keyYOUR_LLM_API_KEY
Model IDclaude-sonnet-5
ClineRoo CodeContinueCursorOpenCode

Coding agents burn through tokens fast. A spend cap on the key you give the agent keeps a long session from turning into a surprise bill.

The same values work in frameworks such as LangChain and LlamaIndex through their OpenAI client classes — set the base URL and keep the rest of your code.

Copy and run

Your existing OpenAI client, pointed at LLM.API

Use the official OpenAI package you already know. Your API key belongs on the server, never in browser code.

from openai import OpenAI

client = OpenAI(
    api_key="YOUR_LLM_API_KEY",
    base_url="https://api.llmapi.ai/v1",
)

response = client.chat.completions.create(
    model="claude-sonnet-5",
    messages=[{"role": "user", "content": "Hello"}],
)

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

Using the Responses API? That works too

LLM.API also supports OpenAI's newer Responses API, which many GPT-5 and GPT-6 integrations use. Keep the same client and call client.responses.create.

responses.py
response = client.responses.create(
    model="gpt-6-sol",
    input="Summarise this ticket in one line.",
)

print(response.output_text)
One client

Switch model families with one value

These are current model IDs from the LLM.API catalogue. The rest of the request can stay the same.

model="claude-sonnet-5"
Compatibility

Familiar endpoints, model-specific capabilities

Compatibility describes the request format. Features still depend on the model you select, so check each model page before shipping.

Chat completions

Supported

The standard messages-based request format.

Streaming

Supported

Stream incremental output with the SDK's normal streaming option.

Tool calling

Model-dependent

Choose a model marked Tools in the catalogue.

Structured output

Model-dependent

JSON and schema support vary by model.

Vision input

Model-dependent

Choose a model marked Vision for image inputs.

Embeddings

Supported

Use embedding models from the dedicated embeddings catalogue.

Four steps

A low-risk migration path

Start with one request, confirm the response your application relies on, then widen traffic.

01

Create a key

Create an LLM.API account and store the key in your server environment.

02

Set the base URL

Point the OpenAI client at https://api.llmapi.ai/v1.

03

Choose a model ID

Copy the exact identifier from the live model catalogue.

04

Test your response path

Check streaming, tools or structured output with the model you selected.

Troubleshooting

Three checks solve most migration errors

Do not change your whole application first. Confirm the key, endpoint and model identifier in that order.

401 Unauthorized

Confirm that the LLM.API key is present, current and sent as a bearer token.

404 or model not found

Copy the exact model ID from the Models page; display names are not request IDs.

Unexpected response behavior

Confirm that the chosen model supports the feature your code expects, such as tools or vision.

Next steps

Choose, compare and control spend

Use the live catalogue and independent research pages before deciding which model should receive production traffic.

Questions

OpenAI-compatible API FAQ

What compatibility means in practice when you move an existing integration.

What does OpenAI-compatible mean?

It means you can use the familiar OpenAI SDK and request format with LLM.API by setting a different base URL and API key.

Do I need to rewrite my application?

Usually not. Start by changing the API key, base URL and model ID. Test any model-specific features your application uses.

Can I use models from different companies?

Yes. LLM.API exposes supported model families through one API. Change the model ID to switch between them.

Does every model support tools, JSON and vision?

No. Those capabilities depend on the selected model. Check the model catalogue and the individual model page before relying on one.

Can I keep using the official OpenAI SDK?

Yes. The examples above use the official OpenAI Python and JavaScript packages with a custom base URL.

Where should I store my API key?

Store it in a server-side environment variable or secret manager. Do not expose it in public browser code.

Keep the SDK. Expand your model options.

Create an API key, run the example above, and test your first OpenAI-compatible request through LLM.API.

Get your API key →