Skip to main content
An OpenAI-compatible chat completions endpoint. If you’re already using the OpenAI SDK, simply change 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
string
required
Model identifier. Use GET /v1/models to query available models.
messages
array
required
Array of conversation messages. Each message includes role and content fields.
stream
boolean
default:"false"
Whether to use SSE streaming response.
temperature
number
Sampling temperature, range 0-2. Higher values produce more random output. Some models do not support this parameter (see model capabilities).
max_tokens
integer
Maximum number of tokens to generate.
top_p
number
Nucleus sampling parameter.
frequency_penalty
number
Frequency penalty parameter, range -2.0 to 2.0.
presence_penalty
number
Presence penalty parameter, range -2.0 to 2.0.
stop
string | string[]
Stop sequences for generation.
tools
array
Function Calling tool definition array (same format as OpenAI).
tool_choice
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 change base_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 the profy-<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)

Set stream: 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 the X-Session-Id response header. Pass the session ID in subsequent calls to continue the conversation:
  • Request body session_id field (recommended; use extra_body with the OpenAI SDK)
  • Request header X-Session-Id

Expert-as-Model vs. Agents Run

If you need to observe the Agent’s full tool call process (e.g., displaying “Searching…”, “Analyzing data…” intermediate states), use the /v1/agents/run endpoint with the Profy SDK.

Differences from OpenAI

Use GET /v1/models to query each model’s capabilities to check whether the model supports temperature, tools, vision, and other features.

Error Codes

Next Steps

Model List

Query available models and their capabilities

Report Billing Events

Report custom billing events