API Reference
Chat Completions
The primary inference endpoint. OpenAI-compatible — works with any model Plurence supports.
Endpoint
POST https://gateway.plurence.com/v1/chat/completions Request body
| Field | Type | Description |
|---|---|---|
| model | string | Required. Model identifier, e.g. gpt-4o-mini, claude-3-5-sonnet-20241022. |
| messages | array | Required. List of {role, content} objects. |
| stream | boolean | If true, returns Server-Sent Events. Default false. |
| max_tokens | integer | Maximum tokens to generate. |
| temperature | number | Sampling temperature 0–2. Default 1. |
| top_p | number | Nucleus sampling. Default 1. |
| stop | string | array | Stop sequence(s). |
| tools | array | Function/tool definitions for function calling. |
Example
curl
curl https://gateway.plurence.com/v1/chat/completions \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o-mini",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is 2 + 2?"}
]
}' See the full interactive reference with request/response schemas and live examples.
code API Explorer