OpenAI Proxy
OpenAI-Compatible Chat Completions Proxy Endpoint
POST
/api/agents/openai/v1/chat/completionsOverview
100% OpenAI API compatible proxy endpoint. Allows standard OpenAI SDKs (openai-python, openai-node), Cursor, LangChain, and third-party tools to interact with Pinter agents seamlessly.
Authentication & Headers
- Auth: Bearer Token or Developer API Key (
Authorization: Bearer <api_key>) - Required Header:
API-Version: 1
Parameters & Request Body Fields
model(string, required): Target agent UUID or virtual model ID.messages(array of message objects, required): Chat history containingrole(user,assistant,system) andcontent.temperature(number, optional): Sampling temperature.stream(boolean, optional, default: false): Set totruefor OpenAI-compatible streaming chunks.
Request body
application/json
modelstringrequiredmessagesobject[]requiredmessages[].rolestringrequiredmessages[].contentobjectmessages[].namestring | nullmessages[].tool_callsobject[] | nullmessages[].tool_call_idstring | nullstreambooleantemperaturenumber | nullmax_tokensinteger | nulltop_pnumber | nullninteger | nullstopobject | nullpresence_penaltynumber | nullfrequency_penaltynumber | nulluserstring | nulltoolsobject[] | nulltool_choiceobject | nullresponse_formatobject | null{
"model": "string",
"messages": [
{
"role": "string",
"content": null,
"name": "string",
"tool_calls": [
null
],
"tool_call_id": "string"
}
],
"stream": false,
"temperature": 0,
"max_tokens": 0,
"top_p": 0,
"n": 0,
"stop": null,
"presence_penalty": 0,
"frequency_penalty": 0,
"user": "string",
"tools": [
null
],
"tool_choice": null,
"response_format": {}
} Responses
200 Standard OpenAI ChatCompletion response structure
400 Bad Request - The request parameters or headers are invalid (e.g. unsupported API-Version).
401 Unauthorized - Missing, invalid, or expired JWT Bearer token.
403 Forbidden - Insufficient role permissions or resource access denied by RBAC policy.
404 Not Found - The requested resource ID was not found.
422 Validation Error
detailobject[]detail[].locstring | integer[]requireddetail[].msgstringrequireddetail[].typestringrequireddetail[].inputobjectdetail[].ctxobject{
"detail": [
{
"loc": [
null
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}Example
curl -X POST "$PINTER_URL/api/agents/openai/v1/chat/completions" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"model":"string","messages":[{"role":"string","content":null,"name":"string","tool_calls":[null],"tool_call_id":"string"}],"stream":false,"temperature":0,"max_tokens":0,"top_p":0,"n":0,"stop":null,"presence_penalty":0,"frequency_penalty":0,"user":"string","tools":[null],"tool_choice":null,"response_format":{}}'