PricingPrivate deploymentsCustom modelsDocsEnterpriseSign inContact sales

Docs

One base URL. The SDK you already use.

Linkrra AI speaks the OpenAI API. Every sample on this page was run against the live API on 27 November 2026, before it was published.

Quickstart

  1. Create a key. Sign in and create an API key in the console. Keys start with sk-pool-.
  2. Export it. Keep it in the environment, out of your code. export LINKRRA_API_KEY="sk-pool-..."
  3. Send a request. Use the official OpenAI SDK (pip install openai or npm 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")

The reply is a standard chat completion. usage carries the token counts for the request.

Response
{
  "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")

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.

Python
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.

Python
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.

ModelStreamingTool callsJSON Schema
Qwen3 Coder 30Bqwen3-coder-30bYesYesYes
Muse Glimmer 30Bmeta/muse-glimmer-30bYesYesNo
Gemma 4 26Bgemma-4-26b-a4b-itYesYesYes
gpt-oss-20bgpt-oss-20bYesYesYes
Qwen3 30B Instructqwen/qwen3-30b-a3b-instruct-2507YesYesYes
Qwen3 VL 30Bqwen/qwen3-vl-30b-a3b-instructYesYesYes
DeepSeek V4 Prodeepseek/deepseek-v4-proYesYesNo
DeepSeek V4 Flashdeepseek/deepseek-v4-flashYesYesYes
GLM 5.3z-ai/glm-5.3YesYesYes
GLM 5.3 Flashz-ai/glm-5.3-flashYesYesYes

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")

Models

GET /v1/models returns the catalogue with live prices. It needs no key.

curl
curl https://ai.linkrra.com/v1/models

Errors

Errors use the OpenAI error shape: an error object with message, type and code.

HTTP 429
{
  "error": {
    "message": "Rate limit exceeded. Try again later.",
    "type": "rate_limit_error",
    "code": "rate_limit_exceeded"
  }
}
HTTPCodeWhat it means
401invalid_api_keyThe key is missing or not recognised.
402insufficient_creditsThe balance does not cover the request. The body reports current_balance.
404model_not_offeredUnknown model id. The body lists the ids that are available. Nothing is billed.
429rate_limit_exceededToo many requests on this key. Retry-After gives the seconds to wait.
429account_spend_limitA 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