Quickstart
Three steps: create a key, export it, send a request with any OpenAI-compatible SDK.
1. Create an API key
Sign in with Google or GitHub, then create a key from your account. Keys start with
sk-hd-v1- and are shown once — store yours in a secret manager or an environment variable:
export HEIMDALL_API_KEY="sk-hd-v1-..."
2. Pick a model
Browse the model list and copy the id of the model you want, for example
deepseek/deepseek-v4-flash-0731-abliterated. Every model page shows the providers serving it, their prices
and measured performance.
3. Send a request
curl https://api-staging.impossiblecarrot.cc/api/v1/chat/completions \ -H "Authorization: Bearer $HEIMDALL_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "deepseek/deepseek-v4-flash-0731-abliterated", "messages": [{ "role": "user", "content": "Hello" }] }'The response is a standard chat.completion object. Heimdallm adds two fields: provider — the
name of the provider that served the request — and usage.cost, the exact amount charged in USD:
{
"id": "gen-9f2c7e1a4b6d",
"object": "chat.completion",
"model": "deepseek/deepseek-v4-flash-0731-abliterated",
"provider": "ImpCC",
"choices": [
{
"index": 0,
"message": { "role": "assistant", "content": "Hello! How can I help?" },
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 34,
"total_tokens": 46,
"cost": 0.0000148
}
}
Every response also carries an X-Generation-Id header. That id is the id of the completion, and
you can look up the full billing record for it later with
GET /generation.
Streaming
Set "stream": true to receive server-sent events. Chunks follow the OpenAI streaming format; the
final chunk before data: [DONE] carries the usage totals, including cost.
curl -N https://api-staging.impossiblecarrot.cc/api/v1/chat/completions \
-H "Authorization: Bearer $HEIMDALL_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "model": "deepseek/deepseek-v4-flash-0731-abliterated", "stream": true,
"messages": [{ "role": "user", "content": "Hello" }] }'
The OpenAI SDKs stream the same way they do against OpenAI:
stream = client.chat.completions.create(
model="deepseek/deepseek-v4-flash-0731-abliterated",
messages=[{"role": "user", "content": "Hello"}],
stream=True,
)
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="")
See the streaming guide for the frame-by-frame anatomy, keep-alives and how mid-stream errors are delivered.
Next steps
- How Heimdallm works — the marketplace's moving parts in one page.
- Choosing a model — reading prices and measurements to pick between endpoints.
- Models & routing — fall back across models, pin or exclude providers, route by price or speed.
- Pricing & billing — how requests are priced, credits and spend limits.
- Your account — balances, the ledger, keys and routing defaults.
- Errors & rate limits — what to expect when a request cannot be served.
- Chat playground — try any model from the browser, on an API key you hold; requests are billed to that key's workspace.
- Coding playground — build software with an AI agent on a machine of your own, billed by the minute from your credit.