text

Chat Completions

Generate text. OpenAI-compatible request/response; billed per token at the routed model's cost plus the tier margin, exact cents in the response's corent.cost_cents field. Failed generations are never charged.

Send an Idempotency-Key header to make a retry safe: a key this account has already used returns 409 naming the original request instead of generating and charging a second time. Both SDKs deliberately omit the header on chat -- without it a transport error surfaces to the caller rather than resolving to a duplicate -- so this honors the header, it does not require it.

post/v1/chat/completions

Request

  • Base URL: https://api.corent.tech (the document declares no server; this is the origin it was published from)
  • URL: https://api.corent.tech/v1/chat/completions
  • Auth: HTTP bearer

Headers

Idempotency-Keystring nullable

Request body

modelstring required

Either a tier ("corent/text-premium" -- brain-routed, answers with the tier name) or an exact model ("corent-claude-sonnet-5" -- direct access, never substituted). Note the separator: tiers use corent/, models use corent-. GET /v1/models publishes model names in the corent- spelling; older spellings of the same model are still accepted, and the response still answers with the published name.

max_tokensinteger nullable
max_completion_tokensinteger nullable
temperaturenumber nullable
streamboolean
toolsobject[] nullable
tool_choiceunknown
response_formatobject nullable
customer_idstring nullable

Optional tag for YOUR end user, so you can attribute spend: 1 to 128 characters from A-Z a-z 0-9 . _ : @ -. Stored on the job, returned on receipts, and filterable with GET /v1/account/usage?customer_id=...

userstring nullable

Optional tag for YOUR end user, so you can attribute spend: 1 to 128 characters from A-Z a-z 0-9 . _ : @ -. Stored on the job, returned on receipts, and filterable with GET /v1/account/usage?customer_id=...

Response

Successful Response

unknown required

Changes

No recorded changes to this operation across all 1 revision of this API.