API REFERENCE
Chat completions
Generate chat responses through llm.market's OpenAI-compatible gateway and active model catalog.
llm.market exposes the supported OpenAI-compatible endpoints shown here. Use the live model catalog before choosing a model ID.
Authentication
Example
Authorization: Bearer sk-YOUR_LLM_MARKET_KEYPOST /v1/chat/completions
OpenAI-compatible Chat Completions. Works with the official openai SDK by overriding base_url to https://llm.market/v1.
Request body
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Required | Catalog id from GET /v1/models. |
| messages | array | Required | Conversation history. |
| max_tokens / max_completion_tokens | integer | Optional | Output cap. gpt-5* prefers max_completion_tokens; both are forwarded. |
| reasoning_effort | string | Optional | OpenAI-style none|low|medium|high|xhigh. Forwarded as-is on GPT channels. |
| thinking | object | Optional | Claude Messages only: {type, budget_tokens} or adaptive effort. Use POST /v1/messages. |
| temperature | float | Optional | 0–2 when the upstream model allows it. Ignored on some gpt-5/o-series models. |
| stream | boolean | Optional | SSE. Chat Completions requests include stream_options.include_usage. |
| tools | array | Optional | OpenAI function tools on /v1/chat/completions; Claude tool_use on /v1/messages. |
Basic example
Example
curl https://llm.market/v1/chat/completions \
-H "Authorization: Bearer sk-YOUR_LLM_MARKET_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "MODEL_FROM_V1_MODELS",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is the capital of France?"}
],
"max_tokens": 200,
"temperature": 0.7
}'Response shape
Example
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1710000000,
"model": "MODEL_FROM_V1_MODELS",
"choices": [{"index":0,"message":{"role":"assistant","content":"The capital of France is Paris."},"finish_reason":"stop"}],
"usage": {"prompt_tokens":20,"completion_tokens":8,"total_tokens":28}
}Reasoning & thinking
Do not send Claude thinking blocks on /v1/chat/completions. GPT models take reasoning_effort on Chat Completions. Claude Code should call POST /v1/messages with the same API key (Authorization Bearer or x-api-key) and ANTHROPIC_BASE_URL=https://llm.market — not https://llm.market/v1.
Example
{
"env": {
"ANTHROPIC_API_KEY": "sk-YOUR_LLM_MARKET_KEY",
"ANTHROPIC_BASE_URL": "https://llm.market",
"ANTHROPIC_MODEL": "claude-sonnet-5"
}
}Vision & image input
Example
{"role":"user","content":[{"type":"text","text":"What is in this image?"},{"type":"image_url","image_url":{"url":"https://example.com/cat.jpg"}}]}Need a key?
Create one in the dashboard. Discord for llm.market is coming soon.