curl --request POST \
--url https://ai.{environment}.corti.app/v1/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "corti-s1",
"prompt": "The capital of France is",
"max_tokens": 50
}
'{
"id": "<string>",
"object": "text_completion",
"created": 123,
"model": "<string>",
"choices": [
{
"index": 123,
"text": "<string>",
"logprobs": {},
"prompt_logprobs": {},
"prompt_token_ids": [
123
],
"token_ids": [
123
],
"routed_experts": [
"<unknown>"
],
"stop_reason": 123,
"finish_reason": "stop"
}
],
"system_fingerprint": "<string>",
"service_tier": "<string>",
"kv_transfer_params": {},
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123,
"prompt_tokens_details": {}
}
}{
"error": "<string>",
"detail": "<string>"
}{
"error": "<string>",
"detail": "<string>"
}Completions
Create completion
Creates a text completion for the given prompt. Supports streaming via SSE.
POST
/
v1
/
completions
curl --request POST \
--url https://ai.{environment}.corti.app/v1/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "corti-s1",
"prompt": "The capital of France is",
"max_tokens": 50
}
'{
"id": "<string>",
"object": "text_completion",
"created": 123,
"model": "<string>",
"choices": [
{
"index": 123,
"text": "<string>",
"logprobs": {},
"prompt_logprobs": {},
"prompt_token_ids": [
123
],
"token_ids": [
123
],
"routed_experts": [
"<unknown>"
],
"stop_reason": 123,
"finish_reason": "stop"
}
],
"system_fingerprint": "<string>",
"service_tier": "<string>",
"kv_transfer_params": {},
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123,
"prompt_tokens_details": {}
}
}{
"error": "<string>",
"detail": "<string>"
}{
"error": "<string>",
"detail": "<string>"
}Authorizations
Use a Corti-issued bearer token.
Body
application/json
Available options:
corti-s1, corti-s1-instant, corti-s1-mini, corti-s1-mini-instant Single prompt string.
If true, returns SSE with data: {chunk} lines. Terminates with data: [DONE].
Required range:
0 <= x <= 1Maximum tokens to generate.
Required range:
x >= 1Required range:
0 <= x <= 20Response
Successful response. For non-streaming requests, returns a complete text completion. For streaming requests, returns Server-Sent Events (SSE) with incremental text chunks. Terminates with data: [DONE].
Unique completion ID (e.g. cmpl-8acdd476-...).
Available options:
text_completion Unix timestamp (seconds).
The model name used for this response.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?