Skip to content

Agent Keys

The same models, from your own code

An Agent Key lets an agent, script, or app call Cognia models over an OpenAI-compatible API. It spends your balance, inside the limits you set for that key.
Shown once
The secret appears a single time when you create the key. Only a keyed hash is stored, so nobody can read it back, including us.
Spend limit
A cap in US dollars per day, per month, or for the key's lifetime. The cap is checked and reserved atomically, so parallel requests cannot go over it.
Request limit
A cap on how many requests the key may send to a model in the same period. Requests that are refused or released without charge do not count.
Rate and concurrency
Requests per minute and simultaneous requests are limited per key.
Model allowlist
Restrict a key to the models an agent actually needs.
Usage log
Every request made with a key: time, model, tokens, cost, and outcome.
Revoke
Revoking blocks new requests immediately. A request already running finishes and is settled normally.
curl https://usecognia.xyz/v1/chat/completions \
  -H "Authorization: Bearer $COGNIA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "<model-id>",
    "messages": [{"role": "user", "content": "Hello"}]
  }'
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.COGNIA_API_KEY,
  baseURL: "https://usecognia.xyz/v1",
});