Concepts
The five ideas the rest of these docs assume.
Request
A request is one call to /chat/completions or /embeddings. It carries a model id, your messages
or inputs, and whatever parameters that endpoint accepts. Stateless: nothing is remembered between
requests unless you send the history back yourself.
Key
A bearer credential with a prefix of sk-cog-. A key belongs to your account, can be limited to
specific models, can carry a monthly budget, and can be revoked on its own without touching the
others. Everything billable is attributed to the key that made the request, which is why per-key
budgets are the practical way to run several projects or several people on one account.
Token
The unit of both context and billing. Input tokens are what you send, output tokens are what the model writes. A request's cost is the input count at the input rate plus the output count at the output rate. Prices are per million tokens and are in Models and prices.
Context window
The maximum number of tokens a single request can hold, input plus output. cog-fast and cog-pro
both take 262,144 tokens. A longer input is rejected rather than truncated, because a silently
truncated prompt produces a confidently wrong answer.
Credit
The display unit for money in the console and the API. One credit is one cent, so 100 credits is
one dollar. Plans include credits, and usage beyond them is billed at the pay-as-you-go rate unless
you set a hard cap. The token rate itself is identical on every plan; plans differ in concurrency,
context ceilings on cog-pro, retention, auditing and support. See Plans.
How the pieces fit
your client --Bearer key--> api.cognitivers.com/v1 --> model
| |
| +-- meters tokens against the key
+-- streaming: server-sent eventsThere is no prompt classifier in that path. Nothing inspects your request before the model does.