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
Model identifier. Use
GET /v1/models to query available models.Array of conversation messages. Each message includes
role and content fields.Whether to use SSE streaming response.
Sampling temperature, range 0-2. Higher values produce more random output. Some models do not support this parameter (see model capabilities).
Maximum number of tokens to generate.
Nucleus sampling parameter.
Frequency penalty parameter, range -2.0 to 2.0.
Presence penalty parameter, range -2.0 to 2.0.
Stop sequences for generation.
Function Calling tool definition array (same format as OpenAI).
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

