Skip to content
KeenKind.Docs
Console

API request examples

If you use a coding tool, start with Tool setup. This page is for developers sending HTTP requests directly.

These examples use Bash or Zsh on macOS / Linux. Set KEENKIND_API_KEY, then replace YOUR_MODEL_ID with a model from the catalog confirmed for the chosen API.

Terminal commands
export KEENKIND_API_KEY='YOUR_KEENKIND_API_KEY'

Choose the request you need; you do not need to run all three. Generation requests incur actual usage.

Terminal commands
curl --silent --show-error 'https://api.keenkind.ai/v1/responses' \
--header "Authorization: Bearer $KEENKIND_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"model": "YOUR_MODEL_ID",
"input": "Explain unit testing in two sentences."
}'

Chat Completions

Jump to Chat Completions
Terminal commands
curl --silent --show-error 'https://api.keenkind.ai/v1/chat/completions' \
--header "Authorization: Bearer $KEENKIND_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"model": "YOUR_MODEL_ID",
"messages": [
{"role": "user", "content": "Explain unit testing in two sentences."}
]
}'

Anthropic Messages

Jump to Anthropic Messages
Terminal commands
curl --silent --show-error 'https://api.keenkind.ai/v1/messages' \
--header "x-api-key: $KEENKIND_API_KEY" \
--header 'anthropic-version: 2023-06-01' \
--header 'Content-Type: application/json' \
--data '{
"model": "YOUR_MODEL_ID",
"max_tokens": 512,
"messages": [
{"role": "user", "content": "Explain unit testing in two sentences."}
]
}'

Configure the matching protocol’s SDK with:

SDK Base URL Key
OpenAI-compatible SDK https://api.keenkind.ai/v1 Value of KEENKIND_API_KEY
Anthropic-compatible SDK https://api.keenkind.ai Value of KEENKIND_API_KEY

Use an id from the KeenKind catalog. Third-party integrations do not need website login cookies or website-client-specific headers.

Check the result

Jump to Check the result

A successful request returns a model response in the selected protocol, with a matching entry in usage records. For errors, check the status and error code in API troubleshooting. After a network interruption, review records before retrying.