Chat
Chat completions
Endpoint
POST
https:/ / api.ppq.ai/ v1/ chat/ completionshttps://api.ppq.ai/chat/completions, without /v1, also works.
Example
from openai import OpenAI
client = OpenAI(base_url="https://api.ppq.ai/v1", api_key="YOUR_API_KEY")
response = client.chat.completions.create(
model="claude-sonnet-5.5",
messages=[
{"role": "system", "content": "Answer in one sentence."},
{"role": "user", "content": "What is a context window?"},
],
max_tokens=200,
)
print(response.choices[0].message.content)Parameters
Standard OpenAI Chat Completions parameters are accepted. Models differ in which optional ones they support; see each model's supported_parameters in the models endpoint.
modeltakes an ID or alias from AI models, optionally with a routing suffix such as:floor.reasoning, for example{"effort": "high"}, controls reasoning; use it instead of:thinkingon models without a reasoning variant, such as Claude.
PPQ-specific options (with the OpenAI Python SDK, pass these in extra_body):
provider: choose upstream providers, including Zero Data Retention with{"zdr": true}. See Routing preferences.plugins:[{"id": "web"}]searches the web before the model answers. See Online mode.pii_redaction:truereplaces personal data with placeholders before the request reaches the provider and restores it in the reply. See PII redaction.
Good to know
- Streams can contain lines starting with
:. These are keep-alive comments; skip them if you parse the SSE stream yourself. - Insufficient balance returns
402 Payment Required. - The cost of each request is listed in Query history and on Account activity.