Skip to main content
POST
Chat Completions (OpenAI-compatible)

OpenAI SDK Compatibility

This endpoint is fully compatible with the OpenAI SDK. Just change the baseURL and apiKey:

Authentication

This endpoint supports two authentication methods:
  • x-api-key header: x-api-key: YOUR_API_KEY
  • Authorization header: Authorization: Bearer YOUR_API_KEY (OpenAI SDK default)

Supported Models

Multimodal Messages

You can send images and audio alongside text using the OpenAI multimodal message format.

Vision (Image Input)

Send images as URLs or base64 data URIs:
Base64 images are also supported:

Audio Input

Send audio as base64-encoded data (mp3, wav, webm, mp4):

Streaming

When stream: true, the response uses Server-Sent Events in OpenAI chunk format:

Authorizations

x-api-key
string
header
required

API key for authentication. Get yours at https://easy-peasy.ai/settings/api

Headers

x-api-key
string

Your API key. Alternatively, use the Authorization: Bearer header.

Authorization
string

Bearer token authentication (alternative to x-api-key). Format: Bearer YOUR_API_KEY

Body

application/json
messages
object[]
required

Array of message objects for the conversation

model
enum<string>
default:gemini-3-flash

Model to use for the completion. See the models table below for all supported models.

Available options:
gemini-3-flash,
gemini-3-pro,
gemini-3.1-pro,
claude-opus-4-6,
claude-sonnet-4-6,
claude-haiku-4-5,
gpt-5,
gpt-5-mini,
gpt-5.4-instant,
gpt-5.4-thinking,
gpt-5.4-pro,
deepseek-v3,
kimi-k2.5,
glm-5,
minimax-m2p5,
grok-4
stream
boolean
default:false

Enable Server-Sent Events streaming

temperature
number

Sampling temperature (0-2)

max_tokens
integer

Maximum tokens to generate

top_p
number

Nucleus sampling parameter

stop

Stop sequences

Response

Chat completion response

id
string

Unique identifier for the completion

object
enum<string>

Object type

Available options:
chat.completion
created
integer

Unix timestamp of creation

model
string

Model used for the completion

choices
object[]
usage
object