Completions
POST /v1/completionsPlain text completion — the right endpoint for base models without a chat template. Streaming supported.
Request body
Section titled “Request body”| Field | Type | Default | Notes |
|---|---|---|---|
model | string | (the deployment’s model) | Optional; must match if set |
prompt | string | string[] | required | |
stream | bool | false | |
temperature / top_p | float | engine default | |
max_tokens | int | engine default | |
frequency_penalty / presence_penalty | float | engine default | |
stop | string | string[] | — | |
n | int | 1 |
Other OpenAI fields (best_of, echo, logprobs, suffix, seed, …) pass through to the engine.
Example
Section titled “Example”curl https://<your-deployment>.inference.meshive.ai/v1/completions \ -H "Authorization: Bearer $MESHIVE_API_KEY" \ -H "Content-Type: application/json" \ -d '{"prompt": "The capital of France is", "max_tokens": 16}'resp = client.completions.create( model="", prompt="The capital of France is", max_tokens=16,)print(resp.choices[0].text)Rate limiting, timeouts, streaming error events, and status codes are identical to Chat completions.