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

OpenAI SDK compatibility

Use the OpenAI SDK’s chat.completions.create method with the baseURL and apiKey below. This endpoint implements the request fields in this reference; tool calling, response_format, n, and other undocumented OpenAI options are not implemented.

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)

Model IDs and aliases

The REST default is gemini-3.8-flash. The gemini-3-flash alias used in these examples follows the current Flash model and currently resolves to that default. Use an explicit version when you need to avoid a floating alias. These IDs are routed by the chat endpoint; model availability, limits, and multimodal support depend on the provider. Some older names select replacements, rather than the model their name suggests: Choose a listed ID. Unknown names may fall back to the default or reach a provider that rejects them. Parameters such as temperature, top_p, and stop are also model-dependent.

Multimodal Messages

You can send images and audio alongside text using the OpenAI multimodal message format when the selected model supports that input. Accepting the message format does not make every model multimodal. Choose an image-capable model for vision and an audio-capable model for audio input.

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

Body

application/json
messages
object[]
required

Array of message objects for the conversation

Minimum array length: 1
model
string
default:gemini-3.8-flash

Model ID from the Chat Completions model table. Default: gemini-3.8-flash. gemini-3-flash is a floating alias currently resolving to this default. Some legacy IDs resolve to replacement models. Unknown names may fall back to the default or be rejected by the provider; use a documented ID.

Example:

"gemini-3.8-flash"

stream
boolean
default:false

Enable Server-Sent Events streaming

temperature
number

Sampling temperature where supported by the chosen model. Some models ignore or reject custom values.

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