LatentKit

Quickstart

Create an account, copy an API key, set an environment variable, and send your first routed request.

Get from zero to a working /v1/chat request in a few minutes.

1. Create an account

Sign up at console.latentkit.com. New workspaces land on AI Router, which prepares a default route and API key when Platform Access is available.

2. Copy an API key

Open AI Router or API Keys. Copy your key once when it is created — the console masks existing secrets. Store it in a server-side environment variable:

export LATENTKIT_API_KEY="lk_..."

Never commit API keys or expose them in browser bundles.

3. Send a chat request

curl https://ai.latentkit.com/v1/chat \
  -H "Authorization: Bearer $LATENTKIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "messages": [{ "role": "user", "content": "Say hello from LatentKit." }],
    "response_profile": "balanced",
    "max_tokens": 100
  }'
npm install @latentkit/sdk
import { LatentKit } from '@latentkit/sdk';

const client = new LatentKit({ apiKey: process.env.LATENTKIT_API_KEY! });

const response = await client.chat.create({
  messages: [{ role: 'user', content: 'Say hello from LatentKit.' }],
  response_profile: 'balanced',
  max_tokens: 100,
});

console.log(response.content);
pip install latentkit
import os
from latentkit import LatentKit

with LatentKit(api_key=os.environ["LATENTKIT_API_KEY"]) as client:
    response = client.chat.create(
        messages=[{"role": "user", "content": "Say hello from LatentKit."}],
        response_profile="balanced",
        max_tokens=100,
    )
    print(response["content"])

4. Understand the response

Successful responses include assistant content and metadata about which route executed. If something fails, read X-LK-Request-ID from response headers and the JSON error field — see Error handling.

Route-based requests

Do not send model, provider, route, or policy in application requests. Change provider/model selection by editing the API key's assigned route in the console.

Optional response depth

Pass response_profile to prefer speed or depth when the route allows overrides:

ValueUse when
fastLower latency, lower token use
balancedDefault quality and speed
deepMore reasoning depth when supported

Next steps

On this page