Legacy completions
POST /v1/completions takes a single string prompt and is served as a chat completion.
On this page
POST /v1/completions is the older OpenAI text-completion shape: a prompt string in, choices[].text out. The devshard gateways speak chat completions, so OpenBroker translates the body and translates the response back.
bash
curl https://api.openbroker.gonka.gg/v1/completions \
-H "Authorization: Bearer obk-YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "MiniMaxAI/MiniMax-M2.7",
"prompt": "Explain devshards in one sentence.",
"max_tokens": 100
}'What is accepted
promptmust be a single string. A one-element array of one string is also accepted.- Auth, billing, and streaming follow the same rules as chat completions.
stream: trueworks. The translated stream is rewritten into the legacy chunk shape.
What is rejected or dropped
| Input | Result |
|---|---|
Missing prompt | 400 missing required field: prompt |
| An array of several prompts, or token-id prompts | 400 — batch prompts are not supported |
suffix, echo, best_of, logprobs | Removed before the call. They have no chat equivalent here, and they do not fail the request. |
Prefer /v1/chat/completions for new integrations. The legacy route exists so older clients can switch base URL and key without rewriting the prompt field.