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.
- 1Set your keyexport KENDR_API_KEY="kndr_live_..." on macOS/Linux, or $env:KENDR_API_KEY="kndr_live_..." in PowerShell.
- 2Send a chat completionUse kendr-intelligent for request-by-request routing, or replace it with an available alias returned by GET /v1/models.
- 3Keep the receiptRead 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.
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.
| Credential | Who configures it | Where it is sent | Purpose |
|---|---|---|---|
| Kendr API key kndr_live_... | Customer or customer application | Authorization or X-API-Key | Calls model, query, usage, and other API-key-enabled Kendr routes. |
| Kendr session or OAuth token | Kendr login flow | Cookie, X-Kendr-Session, or bearer header | Acts for a signed-in user and can create or revoke Kendr API keys. |
| Connected-service authorization | The signed-in customer | Kendr connection flow only | Allows an explicitly connected app or MCP server to provide data and tools. It is never returned through model API responses. |
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
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"
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: