Chat Completions
POST /v1/chat/completions is the OpenAI-compatible chat endpoint for SDKs, HTTP clients and tools that already speak Chat Completions.
Use it when
- Your app already uses the OpenAI Chat Completions API shape.
- You need standard
messages,tools,tool_choiceorstreambehavior. - You want the broadest compatibility with OpenAI-style SDKs.
Code examples
curl https://api.prismaticapi.com/v1/chat/completions \
-H "Authorization: Bearer $PRISMATIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-4-6",
"messages": [
{ "role": "system", "content": "You are a concise release assistant." },
{ "role": "user", "content": "Write three product taglines." }
],
"stream": false,
"max_tokens": 400
}'import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.PRISMATIC_API_KEY,
baseURL: "https://api.prismaticapi.com/v1"
});
const completion = await client.chat.completions.create({
model: "claude-sonnet-4-6",
messages: [{ role: "user", content: "Write three product taglines." }],
max_tokens: 400
});import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["PRISMATIC_API_KEY"],
base_url="https://api.prismaticapi.com/v1",
)
completion = client.chat.completions.create(
model="claude-sonnet-4-6",
messages=[{"role": "user", "content": "Write three product taglines."}],
max_tokens=400,
)Parameters
model(string, required) — Public model ID returned byGET /v1/models.messages(array, required) — Conversation turns withroleandcontent.max_tokensormax_completion_tokens(integer, optional) — Maximum generated output tokens.stream(boolean, optional) — Enables OpenAI-style SSE streaming.temperature,top_p,stop,toolsandtool_choiceare accepted when supported by the selected model.
Billing and limits
- API-key and account rate limits are checked before generation.
- Subscription quota is reserved before generation and settled afterward.
- PAYG fallback can cover the request only when enabled and sufficiently funded.