Quickstart
- Create a key. Sign in and create an API key in the console. Keys start with
sk-pool-. - Export it. Keep it in the environment, out of your code.
export LINKRRA_API_KEY="sk-pool-..." - Send a request. Use the official OpenAI SDK (
pip install openaiornpm install openai) with our base URL.
import os from openai import OpenAI client = OpenAI( base_url="https://ai.linkrra.com/v1", api_key=os.environ["LINKRRA_API_KEY"], ) reply = client.chat.completions.create( model="qwen3-coder-30b", messages=[{"role": "user", "content": "What does HTTP 429 mean?"}], ) print(reply.choices[0].message.content) print(reply.usage.prompt_tokens, "in,", reply.usage.completion_tokens, "out")
import OpenAI from "openai"; const client = new OpenAI({ baseURL: "https://ai.linkrra.com/v1", apiKey: process.env.LINKRRA_API_KEY, }); const reply = await client.chat.completions.create({ model: "qwen3-coder-30b", messages: [{ role: "user", content: "What does HTTP 429 mean?" }], }); console.log(reply.choices[0].message.content); console.log(reply.usage.prompt_tokens, "in,", reply.usage.completion_tokens, "out");
curl https://ai.linkrra.com/v1/chat/completions \ -H "Authorization: Bearer $LINKRRA_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "qwen3-coder-30b", "messages": [{"role": "user", "content": "What does HTTP 429 mean?"}] }'
The reply is a standard chat completion. usage carries the token counts for the request.
{
"id": "chatcmpl-bc4dbb6e0f13b638",
"object": "chat.completion",
"model": "qwen3-coder-30b",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "HTTP 429 means \"Too Many Requests\" - it's a status code that ..."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 17,
"completion_tokens": 256,
"total_tokens": 273
}
}Streaming
Set stream to true. With stream_options.include_usage, the final chunk carries the token counts.
import os from openai import OpenAI client = OpenAI( base_url="https://ai.linkrra.com/v1", api_key=os.environ["LINKRRA_API_KEY"], ) stream = client.chat.completions.create( model="qwen3-coder-30b", messages=[{"role": "user", "content": "Explain idempotency keys briefly."}], stream=True, stream_options={"include_usage": True}, # usage arrives in the last chunk ) for chunk in stream: if chunk.choices and chunk.choices[0].delta.content: print(chunk.choices[0].delta.content, end="", flush=True) if chunk.usage: print(f"\n{chunk.usage.total_tokens} tokens")
import OpenAI from "openai"; const client = new OpenAI({ baseURL: "https://ai.linkrra.com/v1", apiKey: process.env.LINKRRA_API_KEY, }); const stream = await client.chat.completions.create({ model: "qwen3-coder-30b", messages: [{ role: "user", content: "Explain idempotency keys briefly." }], stream: true, stream_options: { include_usage: true }, // usage arrives in the last chunk }); for await (const chunk of stream) { process.stdout.write(chunk.choices[0]?.delta?.content ?? ""); if (chunk.usage) console.log(`\n${chunk.usage.total_tokens} tokens`); }
Tool calls
Declare functions in the OpenAI tools format. The model answers with tool_calls; run the function and return its result in a tool message.
import json import os from openai import OpenAI client = OpenAI( base_url="https://ai.linkrra.com/v1", api_key=os.environ["LINKRRA_API_KEY"], ) MODEL = "qwen3-coder-30b" tools = [{ "type": "function", "function": { "name": "get_order_status", "description": "Look up the status of an order by its id.", "parameters": { "type": "object", "properties": {"order_id": {"type": "string"}}, "required": ["order_id"], }, }, }] messages = [{"role": "user", "content": "Where is order A-1042?"}] first = client.chat.completions.create(model=MODEL, messages=messages, tools=tools) call = first.choices[0].message.tool_calls[0] args = json.loads(call.function.arguments) # {"order_id": "A-1042"} # Run your own function, then hand the result back to the model. result = {"order_id": args["order_id"], "status": "shipped", "eta": "2026-12-02"} messages += [ first.choices[0].message, {"role": "tool", "tool_call_id": call.id, "content": json.dumps(result)}, ] final = client.chat.completions.create(model=MODEL, messages=messages, tools=tools) print(final.choices[0].message.content)
Structured outputs
Pass a JSON Schema as response_format and parse the reply as JSON.
import json import os from openai import OpenAI client = OpenAI( base_url="https://ai.linkrra.com/v1", api_key=os.environ["LINKRRA_API_KEY"], ) schema = { "type": "object", "properties": { "vendor": {"type": "string"}, "amount": {"type": "number"}, "currency": {"type": "string"}, "date": {"type": "string"}, }, "required": ["vendor", "amount", "currency", "date"], "additionalProperties": False, } text = "ACME Ltd billed 1,250.50 USD on 3 March 2026." reply = client.chat.completions.create( model="qwen3-coder-30b", messages=[{"role": "user", "content": f"Extract the invoice: {text}"}], response_format={ "type": "json_schema", "json_schema": {"name": "invoice", "strict": True, "schema": schema}, }, ) invoice = json.loads(reply.choices[0].message.content) print(invoice["vendor"], invoice["amount"], invoice["currency"], invoice["date"])
Model support
Measured, not copied from a model card: one real request per cell on 27 November 2026. A cell reads Yes only when the reply had the right shape.
| Model | Streaming | Tool calls | JSON Schema |
|---|---|---|---|
| Qwen3 Coder 30Bqwen3-coder-30b | Yes | Yes | Yes |
| Muse Glimmer 30Bmeta/muse-glimmer-30b | Yes | Yes | No |
| Gemma 4 26Bgemma-4-26b-a4b-it | Yes | Yes | Yes |
| gpt-oss-20bgpt-oss-20b | Yes | Yes | Yes |
| Qwen3 30B Instructqwen/qwen3-30b-a3b-instruct-2507 | Yes | Yes | Yes |
| Qwen3 VL 30Bqwen/qwen3-vl-30b-a3b-instruct | Yes | Yes | Yes |
| DeepSeek V4 Prodeepseek/deepseek-v4-pro | Yes | Yes | No |
| DeepSeek V4 Flashdeepseek/deepseek-v4-flash | Yes | Yes | Yes |
| GLM 5.3z-ai/glm-5.3 | Yes | Yes | Yes |
| GLM 5.3 Flashz-ai/glm-5.3-flash | Yes | Yes | Yes |
Where a cell reads No, the model answered in prose instead of the schema. Validate its output, or pick a model that reads Yes.
Embeddings
qwen3-embedding-0.6b returns 1,024-dimension vectors at $0.009 per one million tokens.
import os from openai import OpenAI client = OpenAI( base_url="https://ai.linkrra.com/v1", api_key=os.environ["LINKRRA_API_KEY"], ) result = client.embeddings.create( model="qwen3-embedding-0.6b", input=["How do I rotate an API key?", "Our refund policy covers 30 days."], ) print(len(result.data), "vectors of", len(result.data[0].embedding), "dimensions")
curl https://ai.linkrra.com/v1/embeddings \ -H "Authorization: Bearer $LINKRRA_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "qwen3-embedding-0.6b", "input": ["How do I rotate an API key?", "Our refund policy covers 30 days."] }'
Models
GET /v1/models returns the catalogue with live prices. It needs no key.
curl https://ai.linkrra.com/v1/models
Errors
Errors use the OpenAI error shape: an error object with message, type and code.
{
"error": {
"message": "Rate limit exceeded. Try again later.",
"type": "rate_limit_error",
"code": "rate_limit_exceeded"
}
}| HTTP | Code | What it means |
|---|---|---|
| 401 | invalid_api_key | The key is missing or not recognised. |
| 402 | insufficient_credits | The balance does not cover the request. The body reports current_balance. |
| 404 | model_not_offered | Unknown model id. The body lists the ids that are available. Nothing is billed. |
| 429 | rate_limit_exceeded | Too many requests on this key. Retry-After gives the seconds to wait. |
| 429 | account_spend_limit | A spend limit you set was reached. The body names the window and the cap. |
One difference from OpenAI: n greater than 1 is not supported. Send one request per completion.
Rate limits
Limits are set per API key. Every response carries X-RateLimit-Remaining and X-RateLimit-Reset (Unix time in milliseconds). For a higher limit, talk to us.
Something missing or wrong on this page? weare@linkrra.com