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>"
}Body
application/json
Response
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].
Was this page helpful?