POST demo/chat-completions
POST /api/v1/demo/chat-completions
Accepts a prompt accompanied by the client pre-tokenization markers through the authenticated demo chat and returns the model response. The gateway checks the request markers and MAC; it does not verify that tokenization ran.
Authenticate with an API key.
Request body
application/json object
messagestringLength: at most 8000 charactersmessagesarray of objectItems: 1 to 60 itemsEach item:
contentstring requiredrolestring requiredOne of:"user","assistant","system"
modelstringLength: at most 64 characters
Generated sample
{
"message": "string",
"messages": [
{
"content": "string",
"role": "user"
}
],
"model": "string"
}Responses
200 Successful response.
application/json object
Any keys are accepted.
401 Error response.
application/json GenericError
erroranyOne of
- string
- object
Any keys are accepted.
error_codestringcodestringmessagestringdetailstringstatusanyOne of
- string
- integer
errorsobjectAny keys are accepted.
403 Error response.
application/json GenericError
erroranyOne of
- string
- object
Any keys are accepted.
error_codestringcodestringmessagestringdetailstringstatusanyOne of
- string
- integer
errorsobjectAny keys are accepted.
413 Error response.
application/json GenericError
erroranyOne of
- string
- object
Any keys are accepted.
error_codestringcodestringmessagestringdetailstringstatusanyOne of
- string
- integer
errorsobjectAny keys are accepted.
415 Error response.
application/json GenericError
erroranyOne of
- string
- object
Any keys are accepted.
error_codestringcodestringmessagestringdetailstringstatusanyOne of
- string
- integer
errorsobjectAny keys are accepted.
422 The request failed validation.
application/json object
Any keys are accepted.
428 The required pretokenized request marker is missing.
application/json GenericError
erroranyOne of
- string
- object
Any keys are accepted.
error_codestringcodestringmessagestringdetailstringstatusanyOne of
- string
- integer
errorsobjectAny keys are accepted.
429 The route throttle limit was exceeded.
application/json GenericError
erroranyOne of
- string
- object
Any keys are accepted.
error_codestringcodestringmessagestringdetailstringstatusanyOne of
- string
- integer
errorsobjectAny keys are accepted.
text/html string
502 Error response.
application/json GenericError
erroranyOne of
- string
- object
Any keys are accepted.
error_codestringcodestringmessagestringdetailstringstatusanyOne of
- string
- integer
errorsobjectAny keys are accepted.
503 The demo configuration, provider pricing, or usage limits are unavailable.
Response headers
Retry-Afterstring headerRetry delay in seconds.
application/json any
One of
- object
errorobject requiredmessagestring requiredcodestring requiredValue:"demo_rate_limit_unavailable"typestring requiredValue:"service_unavailable"
- object
errorstring requiredcodestring requiredValue:"demo_unconfigured"