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 | Model ID. Use GET /v1/models to discover IDs. |
| messages | array | Required | Conversation history. |
| max_tokens | integer | Optional | Maximum tokens to generate. |
| temperature | float | Optional | Sampling temperature 0–2 when supported by the upstream model. |
| stream | boolean | Optional | Server-Sent Events stream. Streaming requests ask upstream for final usage. |
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
Pass only parameters supported by the active upstream model. Model-specific capability guarantees are not inferred by this API.
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"}}]}Stuck on setup, or want a free key?
Ask the community on our Discord.