Quickstart
Your first request against the Cognitivers API, in the client you already use.
You need two things: a key, and a client that speaks OpenAI chat completions.
1. Get a key
Create a key in the console. It looks like sk-cog-a1b2c3... and it is shown once, so store it
where your tooling reads secrets from. Do not paste it into a repository.
Set it in the environment so it never appears in a command history or a config file:
export COGNITIVERS_API_KEY="sk-cog-..."Treat the key as a bearer credential: anyone who has it can spend against your account. Keys can be scoped, budgeted and revoked individually, which is what Authentication covers.
2. Make a request
curl https://api.cognitivers.com/v1/chat/completions \
-H "Authorization: Bearer $COGNITIVERS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "cog-fast",
"messages": [
{ "role": "user", "content": "List three ways to detect a scheduled task that hides itself." }
]
}'3. Stream the answer
Streaming is server-sent events, the same shape OpenAI clients already parse.
curl https://api.cognitivers.com/v1/chat/completions \
-H "Authorization: Bearer $COGNITIVERS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "cog-pro",
"stream": true,
"messages": [{ "role": "user", "content": "Draft the opening scene of a noir set in a port city." }]
}'For very large inputs, send the same request to https://stream.cognitivers.com/v1 instead. Same
key, same body; the difference is how the connection is held while the model reads a long prompt.
See Long context.
4. Pick the right model
| Model | Use it for |
|---|---|
cog-fast | Agents, pipelines, extraction, volume. Anything that runs unattended. |
cog-pro | One hard task at a time, where the whole answer has to be there. |
cog-embed | Retrieval over your own text, including material another API would refuse to index. |
Ids, context windows and prices are on Models and prices.