AI inference
Calling a language model from your own programs with an OpenAI-compatible API, paying per token, with your prompts processed in Switzerland and never stored.
What it is
Gigakube serves open-weight language models through an API that speaks the same language as OpenAI's chat completions: the OpenAI SDKs, LangChain, LlamaIndex and most tools that let you set a "base URL" work unchanged. The models run on Daiko Lab's own inference service in Switzerland, the same one behind the panel's AI assistant; no third-party AI provider receives your requests.
Today the available model is gemma-4-26b (Google Gemma 4, 26B). The live list is in the panel and on GET /api/ai/v1/models.
Before you start
You need:
- an API key of the project that pays (see API keys) with the role Can edit or Can manage. A Can view key can only list the models. A key that requires approval for every change cannot use inference: a token spent cannot be approved afterwards. Create a separate key for inference;
- credit on the account that owns the project: inference is charged to the project's owner, like everything else in the project (see Billing and invoices).
The panel's AI inference page (left menu) shows the endpoint, the models, the prices, ready-to-copy examples and what the project has used this month.
The endpoint
Base URL: https://gigakube.ch/api/ai/v1
POST /chat/completions
GET /models
Authorization: Bearer gk_…
With curl:
curl https://gigakube.ch/api/ai/v1/chat/completions \
-H "Authorization: Bearer $GIGAKUBE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemma-4-26b",
"messages": [
{"role": "system", "content": "You answer in one sentence."},
{"role": "user", "content": "What is a VTEP?"}
]
}'
With the OpenAI SDK for Python:
import os
from openai import OpenAI
client = OpenAI(base_url="https://gigakube.ch/api/ai/v1", api_key=os.environ["GIGAKUBE_API_KEY"])
reply = client.chat.completions.create(
model="gemma-4-26b",
messages=[{"role": "user", "content": "What is a VTEP?"}],
)
print(reply.choices[0].message.content)
print(reply.usage) # the tokens you are charged for
Streaming
Set "stream": true to receive the answer piece by piece as server-sent events, exactly as with OpenAI:
stream = client.chat.completions.create(
model="gemma-4-26b",
messages=[{"role": "user", "content": "Write a haiku about Zurich."}],
stream=True,
stream_options={"include_usage": True}, # optional: the last event carries the token counts
)
for event in stream:
if event.choices:
print(event.choices[0].delta.content or "", end="")
If you close the connection before the end, the model still finishes the answer and the tokens it generated are charged: set max_tokens to what you really need.
Limits
| Limit | Value |
|---|---|
Tokens in one answer (max_tokens, or max_completion_tokens) |
at most 8,192; without it, 8,192. A larger value is refused, not lowered |
Choices per request (n) |
1 |
| Requests per key | 60 per minute, 4 running at the same time; plus the 120 requests per minute that every key has across the API and the MCP |
| Request size | 1 MB |
Over a limit you get 429 with Retry-After. Other parameters (temperature, top_p, stop, tools, …) are passed to the model as they are; what the model does not support, it refuses.
What it costs
Two meters, priced per million tokens, VAT excluded:
- input tokens: the messages you send (system prompt and conversation included), every time you send them;
- output tokens: the answer.
The counts are the ones the model reports in usage with every answer, and are what you are charged: we never estimate. Usage is charged to the project owner's account by the minute, appears in Billing under the meters ai_in_mtok and ai_out_mtok and in the project's costs (Billing/getProjectUsage, MCP cloud_get_costs), and ends up on the monthly statement like any other usage. The prices are on gigakube.ch/pricing and, with any discount of yours, in Billing → Your prices.
Without credit (prepaid accounts at zero, or at the end of the credit limit) inference is refused with 402, like the creation of any paid resource.
Your data
- Your prompts and the answers are not stored or logged by Gigakube: they pass through the portal to the inference service and back, and are kept nowhere.
- What we keep, for billing and for your usage figures, is only: the project, the key, the model, the number of input and output tokens, the duration and the outcome of each request. These records are kept for 90 days; the charged amounts become part of your billing records.
- The inference service is Daiko Lab's own, in Switzerland. Requests do not leave Switzerland and no third-party AI provider receives them. See the Privacy Policy.
Errors
Errors come in OpenAI's format, {"error": {"message", "type", "param", "code"}}:
| Status | code |
What it means |
|---|---|---|
| 401 | invalid_api_key |
The key is missing, revoked or expired |
| 403 | role_too_low |
The key has the role Can view: use a Can edit or Can manage key |
| 403 | key_needs_approval |
The key requires approval for every change: use a key without approval |
| 404 | model_not_found |
The model is not one of those listed by /models |
| 400 | invalid_request |
Something in the request is not valid; the message says what |
| 402 | insufficient_credit |
The account that owns the project has no credit left: top it up |
| 429 | rate_limit_exceeded, too_many_concurrent_requests, rate_limited |
Too many requests: wait and retry |
| 503 | overloaded |
The inference service is busy: retry in a few seconds. Nothing was charged |
| 503 | stream_unavailable |
Streaming is temporarily off: send the same request with "stream": false |
| 503 | not_priced |
Inference is not switched on for your account's price list yet: write to us |
| 502 | usage_missing, upstream_error |
The inference service did not answer properly. Nothing was charged |