Chat
Responses API
PPQ serves a drop-in replacement for OpenAI's Responses API, OpenAI's newer endpoint for agentic loops that supersedes Chat Completions for tool-using and reasoning workflows. Authentication, billing, balance checks and the model catalog are the same as for Chat completions. Use it from clients that expect the Responses schema, such as client.responses.create() in the OpenAI SDK, the OpenAI Agents SDK and other agent frameworks.
Endpoint
https:/ / api.ppq.ai/ v1/ responsesAlias
https:/ / api.ppq.ai/ responsesThe same endpoint without the /v1 prefix.
Example
from openai import OpenAI
client = OpenAI(
api_key="YOUR_API_KEY",
base_url="https://api.ppq.ai/v1"
)
response = client.responses.create(
model="openai/gpt-6.1-sol",
input="Hello, how are you?",
)
print(response.output_text)Request body
model and input are required. PPQ accepts the same payloads as OpenAI's Responses API; the full schema is in the OpenAI Responses API reference.
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | |
input | string | array | Yes | The prompt as plain text, or an array of role-tagged messages and content items (text, images, files). |
instructions | string | No | System-level guidance prepended to the conversation. |
max_output_tokens | integer | No | Maximum number of tokens to generate for the response. |
temperature | number | No | Sampling temperature, from 0 to 2. |
top_p | number | No | Nucleus sampling. |
tools | array | No | Tools the model can call: functions, web_search, file_search, code_interpreter, MCP and others. |
tool_choice | string | object | No | Constrains tool selection. One of "auto", "none", "required", or { type, name } for a specific tool. |
parallel_tool_calls | boolean | No | Allow more than one tool call in a turn. |
reasoning | object | No | Settings for reasoning models, for example {"effort": "high"}. effort is "low", "medium" or "high". |
response_format | object | No | Structured output: a JSON schema or json_object. |
previous_response_id | string | No | Continue from an earlier stored response. |
store | boolean | No | Store the response upstream for later retrieval. |
metadata | object | No | Up to 16 key/value tags of your own: strings, numbers or booleans. OpenAI SDK clients accept only strings; numbers and booleans need plain HTTP. |
stream | boolean | No | Stream the response as server-sent events. Final usage and cost arrive in the response.completed event; see Streaming. |
pii_redaction | boolean | No | PPQ extension. true replaces personal data in the input with placeholders before the request reaches the provider, and restores it in the response. Cannot be combined with previous_response_id or conversation. See PII redaction. |
Response
Without streaming, you get a single response object:
{
"id": "resp_…",
"object": "response",
"model": "openai/gpt-6.1-sol",
"status": "completed",
"output": [ /* messages, tool calls, reasoning, … */ ],
"output_text": "concatenated assistant text",
"usage": { "input_tokens": 12, "output_tokens": 34, "total_tokens": 46 },
"created_at": 1709234567
}Streaming
With "stream": true, the server sends server-sent events in this order:
| Event | Meaning |
|---|---|
response.created | The initial response object. |
response.in_progress | Processing has started. |
response.output_item.added, response.content_part.added | A new output item or content part. |
response.output_text.delta | Incremental text tokens. |
response.output_text.done, response.output_item.done | A content part or output item is finished. |
response.completed | Final event. Carries the final usage (input, output and cached tokens, and cost) that PPQ bills from. |
response.failed | Final event when the request fails. |
Limits and errors
private/*models are not supported on this endpoint. For end-to-end encrypted requests through the local proxy, see Private (TEE) models.- Insufficient balance returns
402 Payment Required, the same as Chat completions.