Get started

Quickstart

Add credit, create an API key and send your first request with curl, Python or JavaScript.

On this page

1. Add credit

Models only run on prepaid credit, and every account starts at $0, so add some first. Sign in or create an account, open Billing and choose an amount from $5 to $500. Payment is handled by Stripe, and the credit shows in your balance once the payment is confirmed. Each model’s prices, per million tokens, are on the Models page.

2. Create an API key

Open Developer in your dashboard, give the key a name you’ll recognise, such as the app that will use it, and create it. You can have up to 20 active keys.

Put the key in an environment variable rather than in your code. The examples on these pages read it from KALSENTI_API_KEY:

export KALSENTI_API_KEY="sk-kalsenti-..."

If it’s been more than two hours since you signed in, we’ll ask you to confirm it’s you before showing a new key. Why we ask.

3. Send your first request

Send a chat completion. With Python or JavaScript, install the OpenAI SDK first (pip install openai or npm install openai); curl needs nothing extra.

curl https://gateway.kalsenti.ai/v1/chat/completions \
  -H "Authorization: Bearer $KALSENTI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-v4.1-flash-1017-raw",
    "messages": [{ "role": "user", "content": "Write a haiku about the sea." }]
  }'

The examples use deepseek-v4.1-flash-1017-raw. Any model id from the Models page or GET /v1/models works in its place. The reply comes back in the same format you sent:

Response
{
  "id": "chatcmpl_5f0c2a9e41d7b83c6a1e9f04",
  "object": "chat.completion",
  "created": 1793270400,
  "model": "deepseek-v4.1-flash-1017-raw",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Grey waves fold and break,\nsalt wind carries the gulls home,\nthe tide keeps its time."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 15,
    "completion_tokens": 24,
    "total_tokens": 39
  }
}

Got an error instead? 401 means the key wasn’t accepted and 429 with insufficient_quota means your balance is too low. Errors lists them all.

4. Stream the reply

Add "stream": true to receive the reply as it’s written, as server-sent events. Long replies feel faster this way, and nothing has to wait for the whole answer.

curl -N https://gateway.kalsenti.ai/v1/chat/completions \
  -H "Authorization: Bearer $KALSENTI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-v4.1-flash-1017-raw",
    "stream": true,
    "stream_options": { "include_usage": true },
    "messages": [{ "role": "user", "content": "Write a haiku about the sea." }]
  }'

The Python and JavaScript snippets reuse the client from step 3. Each event carries a small piece of the reply, and data: [DONE] ends the stream. See Streaming for the exact events.

Next steps