Completions

Create a completion (legacy)

OpenAI's deprecated text-completion shape, served for compatibility with older SDK pins and scripts. Prefer POST /v1/chat/completions for anything new.

Takes prompt instead of messages and returns choices[].text instead of choices[].message.content. Everything else — models, pricing, streaming, failover — is identical, because this is an adapter over the chat endpoint rather than a separate path.

Not supported: suffix (fill-in-the-middle), a multi-element prompt array, and echo together with stream. Each returns 400 naming the alternative rather than silently returning something that looks right.

post/completions

Request

  • Base URL: https://kymaapi.com/v1
  • URL: https://kymaapi.com/v1/completions
  • Auth: bearerAuth (a scheme the document does not define)

Request body

modelstring required
promptstring required

The text to complete. A single-element array is accepted; more than one is refused.

max_tokensinteger
temperaturenumber
streamboolean
echoboolean

Prepend the prompt to the completion. Cannot be combined with stream.

Example request

{
  "model": "qwen3.7-flash",
  "prompt": "Write a haiku about routing"
}

Response

A legacy text_completion object.

idstring
objectstring
createdinteger
modelstring
usageobject

Identical to the chat endpoint, including usage.cost.

Example response

{
  "object": "text_completion",
  "choices": [
    {
      "finish_reason": "stop"
    }
  ]
}

Changes

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