API reference
Infinized LLM API
Infinized LLM speaks the documented part of OpenAI's Chat Completions API. Point an existing client at https://llm.infinized.com/v1, use an Infinized LLM key, and pick an Infinized model. The API is stateless: send the conversation you want answered with every call.
Quickstart
Sign in at llm.infinized.com with your Infinized account and create a key under API keys.
curl https://llm.infinized.com/v1/chat/completions \
-H "Authorization: Bearer $INFINIZED_LLM_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "infinized-mini-v1",
"messages": [
{"role": "system", "content": "Answer in one sentence."},
{"role": "user", "content": "Summarise: the delivery arrives a day late."}
]
}'
Python
from openai import OpenAI
client = OpenAI(base_url="https://llm.infinized.com/v1", api_key=os.environ["INFINIZED_LLM_KEY"])
reply = client.chat.completions.create(
model="infinized-nano-v1",
messages=[{"role": "user", "content": "Label this ticket as billing, delivery or other: my invoice is wrong."}],
max_tokens=16,
)
print(reply.choices[0].message.content, reply.usage)
JavaScript
import OpenAI from 'openai';
const client = new OpenAI({ baseURL: 'https://llm.infinized.com/v1', apiKey: process.env.INFINIZED_LLM_KEY });
const stream = await client.chat.completions.create({
model: 'infinized-mini-v1',
messages: [{ role: 'user', content: 'Summarise this email in one line: …' }],
stream: true,
stream_options: { include_usage: true },
});
for await (const chunk of stream) process.stdout.write(chunk.choices[0]?.delta?.content ?? '');
Authentication
Send the key as Authorization: Bearer ifl_live_…. Keys belong to one Infinized workspace; you see a key once, when you create it. A revoked or expired key is refused at once. Never put a key in a URL: the API does not read keys from the query string.
Models
Infinized models, run on Infinized's own servers in the Netherlands. A model id never changes what it points at: a model that behaves differently gets a new id. GET https://llm.infinized.com/v1/models lists the models your key can call, with their context and price.
| Model | Context | Answer | Good for |
|---|---|---|---|
infinized-nano-v1 · Infinized Nano | 2,048 tokens | up to 512 tokens (default 256) | classify, extract, rewrite |
infinized-mini-v1 · Infinized Mini | 4,096 tokens | up to 512 tokens (default 256) | summarise, extract, answer |
The context is the whole templated conversation plus the tokens reserved for the answer. A conversation that does not fit is refused with context_length_exceeded; it is never cut short silently. These are small models: give them well-defined tasks, not open-ended chat or code.
Chat completions
POST https://llm.infinized.com/v1/chat/completions with a JSON body:
| Field | Accepted |
|---|---|
model | Required. A model id from /models. |
messages | Required. Roles system (or developer), user and assistant; content as a string or a list of text parts. |
max_tokens / max_completion_tokens | One of the two, 1 up to the model's answer limit. |
temperature, top_p | 0–2 and 0.01–1. Each model has a tested default. |
stop | A string or up to 4 strings of at most 64 characters. |
stream, stream_options.include_usage | See Streaming. |
n | Only 1. |
user | Optional, at most 256 characters: your own label for who the call is for. Kept with the call's metadata and in the usage export; it does not change the answer. |
Anything else — tools, function calling, images, audio, response formats, logprobs — is refused with a 400 that names the field, so a client never assumes a setting took effect. The answer has OpenAI's shape: id, object: "chat.completion", created, model, choices[0].message, finish_reason (stop or length) and usage. Every response carries the request id in X-Request-ID.
Streaming
With "stream": true the answer arrives as server-sent events: data: lines with chat.completion.chunk objects whose choices[0].delta holds the next text, a last chunk with the finish_reason, with include_usage one more chunk with usage and empty choices, and then data: [DONE].
Once a stream has started its status is 200. If the model fails halfway, an {"error": …} event follows and the stream ends without [DONE]. An answer without [DONE] is unfinished. You pay for the prompt and the text that reached you before the failure, as when you disconnect; if no text reached you, nothing.
Usage and billing
- Tokens are counted by the model's own tokenizer and chat template — never estimated from words or characters. Input and output have their own price per million tokens; a call's price is fixed when it is admitted.
- Before a call runs, the most it can cost (the prompt plus
max_tokens) is held on your workspace. You are charged what was measured; the rest is released. - A call that fails on our side, times out or finds no capacity before any text reached you costs nothing. Once a stream sent you text, you pay for the prompt and the tokens sent, whether you disconnect or the call fails or times out after that; before that, nothing.
- A workspace connected to Infinized is billed through Infinized, not here: its usage is reported there per day, and while Infinized's billing lets the workspace start no new work, calls are refused with Infinized's code.
Idempotency
Send Idempotency-Key: <your id> to make a retry safe. For 24 hours, per API key, the same key never starts a second generation: repeating the same request returns 409 request_already_started with the first request's id (look it up with request status); the same key with different content returns 409 idempotency_conflict. Answers are not stored, so there is no replay of the text. Without the header every call is a new call.
Request status
GET https://llm.infinized.com/v1/requests/{id} returns a call of your workspace: its status (completed, cancelled, failed, or running), token counts and settled cost. Never the prompt or the answer. This endpoint is an Infinized extension.
Errors
Errors have OpenAI's shape: {"error": {"type", "code", "message", "param", "request_id"}}. Branch on code.
| Status | Codes |
|---|---|
| 400 | unsupported_parameter, invalid_value, context_length_exceeded, conflicting_parameters, invalid_json |
| 401 / 403 | invalid_api_key; workspace_paused, workspace_blocked |
| 404 | model_not_found, request_not_found |
| 409 | request_already_started, idempotency_conflict |
| 413 | request_too_large (body over 256 KiB) |
| 429 | rate_limit_exceeded, concurrency_limit_exceeded (with Retry-After); billing_not_set_up, credit_limit_reached, payment_overdue, key_limit_reached; for a workspace connected to Infinized, the code Infinized's billing gives (trial_ended, budget_exhausted, package_paused and the like) |
| 503 / 504 | capacity_unavailable, model_unavailable, model_error; timeout — not charged, except in a stream that already sent text: then the prompt and that text |
Limits
During early access each workspace has 30 calls per minute and 1 running at a time; a call may take up to 90 seconds. When every worker is busy a call waits briefly, then gets a 503 with Retry-After. A key can carry its own monthly spending limit.
Privacy
Prompts and answers pass through memory only: we keep request metadata (counts, timing, status, price) and no text. Nothing of one call is kept for another. Your content is not used for training. The models run on Infinized's own servers in the Netherlands.