LiveLLMAPI exposes a single OpenAI-compatible pay-as-you-go gateway. Point any OpenAI SDK at
https://api.livellmapi.com/v1, pass your LiveLLMAPI key, and pay strictly per token.
1. Create an account and add credits on the
Credits page.
2. Create an API key on the API keys page.
3. Call /v1/chat/completions with any model ID from the Models page.
curl https://api.livellmapi.com/v1/chat/completions \
-H "Authorization: Bearer $LIVELLMAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v3.2",
"messages": [{"role": "user", "content": "Hello!"}]
}' curl https://api.livellmapi.com/v1/models -H "Authorization: Bearer $LIVELLMAPI_KEY" Any OpenAI-compatible client works by setting base_url and api_key.
from openai import OpenAI
client = OpenAI(
base_url="https://api.livellmapi.com/v1",
api_key="YOUR_LIVELLMAPI_KEY",
)
resp = client.chat.completions.create(
model="glm-5.2",
messages=[{"role": "user", "content": "Hello!"}],
)
print(resp.choices[0].message.content) import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.livellmapi.com/v1",
apiKey: process.env.LIVELLMAPI_KEY,
});
const resp = await client.chat.completions.create({
model: "glm-5.2",
messages: [{ role: "user", content: "Hello!" }],
});
console.log(resp.choices[0].message.content); Pass "stream": true for Server-Sent Events with final token usage included automatically.
curl https://api.livellmapi.com/v1/chat/completions \
-H "Authorization: Bearer $LIVELLMAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v3.2",
"messages": [{"role": "user", "content": "Count to five"}],
"stream": true
}' Standard OpenAI parameters (tools, tool_choice, response_format, multimodal image_url parts, temperature, top_p, seed) pass through cleanly.
curl https://api.livellmapi.com/v1/chat/completions \
-H "Authorization: Bearer $LIVELLMAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v3.2",
"messages": [{"role": "user", "content": "Weather in Paris?"}],
"tools": [{
"type": "function",
"function": {
"name": "get_weather",
"parameters": {
"type": "object",
"properties": { "city": { "type": "string" } }
}
}
}]
}' curl https://api.livellmapi.com/v1/chat/completions \
-H "Authorization: Bearer $LIVELLMAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "llama-4-maverick",
"messages": [{
"role": "user",
"content": [
{"type": "text", "text": "What is in this image?"},
{"type": "image_url",
"image_url": {"url": "https://example.com/photo.jpg"}}
]
}]
}' curl https://api.livellmapi.com/v1/chat/completions \
-H "Authorization: Bearer $LIVELLMAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v3.2",
"messages": [{"role": "user", "content": "List 3 primes as JSON"}],
"response_format": {"type": "json_object"}
}' Call POST /v1/embeddings for dense retrieval vectors, metered on input tokens only.
curl https://api.livellmapi.com/v1/embeddings \
-H "Authorization: Bearer $LIVELLMAPI_KEY" \
-H "Content-Type: application/json" \
-d '{ "model": "bge-m3", "input": "your text here" }'
Save reusable model + parameter + system-prompt bundles on the Presets page and invoke them with @preset/<slug>.
curl https://api.livellmapi.com/v1/chat/completions \
-H "Authorization: Bearer $LIVELLMAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "@preset/fast-json",
"messages": [{"role": "user", "content": "List 3 primes"}]
}'
Append :online to any model ID to ground answers in live web search results, or call POST /v1/fetch to extract readable text from a URL.
curl https://api.livellmapi.com/v1/chat/completions \
-H "Authorization: Bearer $LIVELLMAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v3.2:online",
"messages": [{"role": "user", "content": "What happened in AI this week?"}]
}' curl https://api.livellmapi.com/v1/fetch \
-H "Authorization: Bearer $LIVELLMAPI_KEY" \
-H "Content-Type: application/json" \
-d '{ "url": "https://example.com/article" }' Every non-streaming response returns exact per-request cost and remaining balance in micro-USD (1 USD = 1,000,000 micro-USD). Cached prompt input tokens are automatically billed at 0.1x the input rate.
HTTP/1.1 200 OK
x-live-cost-micro-usd: 152 # this call cost $0.000152
x-live-balance-micro-usd: 4998480 # balance left, in millionths of a dollar
x-request-id: 8f3c1b9e-... curl "https://api.livellmapi.com/v1/generation?id=chatcmpl-..." \
-H "Authorization: Bearer $LIVELLMAPI_KEY" | HTTP | Type | Meaning |
|---|---|---|
| 401 | auth | Missing or invalid API key |
| 402 | insufficient_credits | Wallet balance is below the request estimate — top up on /credits |
| 429 | rate_limit / spend_cap | Per-key rate limit or rolling 30-day spend cap reached |
| 502 | upstream | Temporary inference error — reservation released, you are not charged |