API essentials

API quickstart

Create a scoped key, send your first request, and read the response.

Quickstart: one key, one request

What you need: a funded Kendr account and a scoped API key created in API keys. Save the key when it is created; its full value is shown once. Keep it on your server or in a local environment variable, never in browser code.

  1. 1
    Set your key
    export KENDR_API_KEY="kndr_live_..." on macOS/Linux, or $env:KENDR_API_KEY="kndr_live_..." in PowerShell.
  2. 2
    Send a chat completion
    Use kendr-intelligent for request-by-request routing, or replace it with an available alias returned by GET /v1/models.
  3. 3
    Keep the receipt
    Read the standard response fields plus kendr_usage and, for routed requests, kendr_routing.
curl https://api.kendr.org/v1/chat/completions \
  -H "Authorization: Bearer $KENDR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "kendr-intelligent",
    "messages": [{"role": "user", "content": "Reply with exactly five words."}]
  }'

A successful response uses the OpenAI Chat Completions shape and adds Kendr settlement metadata. For production retries, also send a stable Idempotency-Key; the server generates a request identifier when you omit one.

Base URL rule

Raw HTTP calls start with https://api.kendr.org. OpenAI-compatible SDKs normally use https://api.kendr.org/v1 because the SDK appends /chat/completions, /responses, or /models.

Know which credential belongs where

Kendr has three credential layers. They solve different problems and are intentionally not interchangeable.

CredentialWho configures itWhere it is sentPurpose
Kendr API key
kndr_live_...
Customer or customer applicationAuthorization or X-API-KeyCalls model, query, usage, and other API-key-enabled Kendr routes.
Kendr session or OAuth tokenKendr login flowCookie, X-Kendr-Session, or bearer headerActs for a signed-in user and can create or revoke Kendr API keys.
Connected-service authorizationThe signed-in customerKendr connection flow onlyAllows an explicitly connected app or MCP server to provide data and tools. It is never returned through model API responses.
Do not proxy vendor secrets from your client

Your integration should send a Kendr API key and a Kendr model alias such as kendr-intelligent. It should not send a vendor API key, Secret Manager ARN, or provider model credential.

Quickstart flow

1
Discover surfaces and packages
Call GET /api/catalog to see the current surfaces, packages, and docs metadata.
2
Authenticate
Use an API key for backend code, or use X-Kendr-Session or OAuth when the request is directly tied to a customer session.
3
Fetch credits and wallet state
Call GET /api/me/dashboard to read the credit balance, packages, purchases, ledger, and enabled surfaces.
4
Run a query
Send the surface key, query string, and optional params to POST /api/v1/query.

Create and use API keys

API keys are customer-scoped credentials. They are created after a customer logs in through a browser session, app session, or OAuth bearer token, and the raw key is returned only once.

Create a key

curl https://api.kendr.org/api/me/api-keys \
  -X POST \
  -H "X-Kendr-Session: $KENDR_SESSION" \
  -H "Content-Type: application/json" \
  -d '{
    "label": "Production"
  }'

List keys

curl https://api.kendr.org/api/me/api-keys \
  -H "X-Kendr-Session: $KENDR_SESSION"
Important

The create response includes raw_token once. Persist it immediately and use the returned api_key.id later for revocation.

Read your first answer

For Chat Completions, read choices[0].message.content and check finish_reason. A result ending with stop completed normally; handle truncation or refusal before using the text. Kendr adds usage and routing receipts. Next, choose a dedicated client guide: