base_url and api_key for a seamless migration.
Authentication
Two authentication methods are supported:- API Key:
Authorization: Bearer sk-pro-xxxx - OAuth Bearer:
Authorization: Bearer <access_token>
Request Body
string
required
Model identifier. Use
GET /v1/models to query available models.array
required
Array of conversation messages. Each message includes
role and content fields.boolean
default:"false"
Whether to use SSE streaming response.
number
Sampling temperature, range 0-2. Higher values produce more random output. Some models do not support this parameter (see model capabilities).
integer
Maximum number of tokens to generate.
number
Nucleus sampling parameter.
number
Frequency penalty parameter, range -2.0 to 2.0.
number
Presence penalty parameter, range -2.0 to 2.0.
string | string[]
Stop sequences for generation.
array
Function Calling tool definition array (same format as OpenAI).
string | object
Tool selection strategy:
"auto", "none", or a specific tool.Non-Streaming Request Examples
Non-Streaming Response
The response includes an additional
balance_remaining field showing the remaining credit balance after the call. This is one of the key differences from OpenAI.Streaming Request Examples
As an OpenAI Drop-In Replacement
If you’re using OpenAI’s official SDK, simply changebase_url and api_key:
Call a Profy Expert (Expert-as-Model)
In addition to calling raw LLM models, you can invoke any published Profy Expert (AI Agent) using theprofy-<identifier> model name format. Behind the scenes, the Expert runs a full Agent stack: persona, tool calls, memory, and skills — but you interact with it just like any other model.
Model Naming Convention
Use
GET /v1/models to discover all available Expert models (type: "expert").
Request Examples (Non-Streaming)
Default behavior (stream omitted or false): the Agent completes all reasoning and tool calls, then returns a single JSON response.
Request Examples (Streaming)
Setstream: true to receive incremental content in real time — useful for displaying text as it’s generated.
Multi-Turn Conversations (Sessions)
A session is automatically created on the first call. The session ID is returned via theX-Session-Id response header. Pass the session ID in subsequent calls to continue the conversation:
- Request body
session_idfield (recommended; useextra_bodywith the OpenAI SDK) - Request header
X-Session-Id
Expert-as-Model vs. Agents Run
Differences from OpenAI
Error Codes
Next Steps
Model List
Query available models and their capabilities
Report Billing Events
Report custom billing events

