curl --request POST \
--url https://easy-peasy.ai/api/chat/completions \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Explain quantum computing in simple terms."
}
],
"model": "gemini-3-flash",
"temperature": 0.7,
"max_tokens": 1000
}
'import requests
url = "https://easy-peasy.ai/api/chat/completions"
payload = {
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Explain quantum computing in simple terms."
}
],
"model": "gemini-3-flash",
"temperature": 0.7,
"max_tokens": 1000
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
messages: [
{role: 'system', content: 'You are a helpful assistant.'},
{role: 'user', content: 'Explain quantum computing in simple terms.'}
],
model: 'gemini-3-flash',
temperature: 0.7,
max_tokens: 1000
})
};
fetch('https://easy-peasy.ai/api/chat/completions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://easy-peasy.ai/api/chat/completions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'messages' => [
[
'role' => 'system',
'content' => 'You are a helpful assistant.'
],
[
'role' => 'user',
'content' => 'Explain quantum computing in simple terms.'
]
],
'model' => 'gemini-3-flash',
'temperature' => 0.7,
'max_tokens' => 1000
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://easy-peasy.ai/api/chat/completions"
payload := strings.NewReader("{\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful assistant.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Explain quantum computing in simple terms.\"\n }\n ],\n \"model\": \"gemini-3-flash\",\n \"temperature\": 0.7,\n \"max_tokens\": 1000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://easy-peasy.ai/api/chat/completions")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful assistant.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Explain quantum computing in simple terms.\"\n }\n ],\n \"model\": \"gemini-3-flash\",\n \"temperature\": 0.7,\n \"max_tokens\": 1000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://easy-peasy.ai/api/chat/completions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful assistant.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Explain quantum computing in simple terms.\"\n }\n ],\n \"model\": \"gemini-3-flash\",\n \"temperature\": 0.7,\n \"max_tokens\": 1000\n}"
response = http.request(request)
puts response.read_body{
"id": "chatcmpl-1741234567890",
"object": "chat.completion",
"created": 1741234567,
"model": "gemini-3-flash",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Quantum computing is..."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 25,
"completion_tokens": 150,
"total_tokens": 175
}
}{
"error": {
"message": "messages is required and must be a non-empty array",
"type": "server_error"
}
}{
"error": {
"message": "Invalid API key",
"type": "server_error"
}
}{
"error": {
"message": "Token limit reached for your subscription plan",
"type": "server_error"
}
}{
"error": {
"message": "Internal server error",
"type": "server_error"
}
}Chat Completions (OpenAI-compatible)
Use the OpenAI SDK’s chat.completions.create method with the Easy-Peasy.AI base URL and API key. Supports the request fields documented here, text responses, and SSE streaming. Multimodal support depends on the selected model. Tool calling, response_format, n, and other undocumented OpenAI options are not implemented by this endpoint.
curl --request POST \
--url https://easy-peasy.ai/api/chat/completions \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Explain quantum computing in simple terms."
}
],
"model": "gemini-3-flash",
"temperature": 0.7,
"max_tokens": 1000
}
'import requests
url = "https://easy-peasy.ai/api/chat/completions"
payload = {
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Explain quantum computing in simple terms."
}
],
"model": "gemini-3-flash",
"temperature": 0.7,
"max_tokens": 1000
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
messages: [
{role: 'system', content: 'You are a helpful assistant.'},
{role: 'user', content: 'Explain quantum computing in simple terms.'}
],
model: 'gemini-3-flash',
temperature: 0.7,
max_tokens: 1000
})
};
fetch('https://easy-peasy.ai/api/chat/completions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://easy-peasy.ai/api/chat/completions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'messages' => [
[
'role' => 'system',
'content' => 'You are a helpful assistant.'
],
[
'role' => 'user',
'content' => 'Explain quantum computing in simple terms.'
]
],
'model' => 'gemini-3-flash',
'temperature' => 0.7,
'max_tokens' => 1000
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://easy-peasy.ai/api/chat/completions"
payload := strings.NewReader("{\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful assistant.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Explain quantum computing in simple terms.\"\n }\n ],\n \"model\": \"gemini-3-flash\",\n \"temperature\": 0.7,\n \"max_tokens\": 1000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://easy-peasy.ai/api/chat/completions")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful assistant.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Explain quantum computing in simple terms.\"\n }\n ],\n \"model\": \"gemini-3-flash\",\n \"temperature\": 0.7,\n \"max_tokens\": 1000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://easy-peasy.ai/api/chat/completions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful assistant.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Explain quantum computing in simple terms.\"\n }\n ],\n \"model\": \"gemini-3-flash\",\n \"temperature\": 0.7,\n \"max_tokens\": 1000\n}"
response = http.request(request)
puts response.read_body{
"id": "chatcmpl-1741234567890",
"object": "chat.completion",
"created": 1741234567,
"model": "gemini-3-flash",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Quantum computing is..."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 25,
"completion_tokens": 150,
"total_tokens": 175
}
}{
"error": {
"message": "messages is required and must be a non-empty array",
"type": "server_error"
}
}{
"error": {
"message": "Invalid API key",
"type": "server_error"
}
}{
"error": {
"message": "Token limit reached for your subscription plan",
"type": "server_error"
}
}{
"error": {
"message": "Internal server error",
"type": "server_error"
}
}OpenAI SDK compatibility
Use the OpenAI SDK’schat.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.
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: 'YOUR_EASY_PEASY_API_KEY',
baseURL: 'https://easy-peasy.ai/api',
});
// Non-streaming
const response = await client.chat.completions.create({
model: 'gemini-3-flash',
messages: [
{ role: 'system', content: 'You are a helpful assistant.' },
{ role: 'user', content: 'Hello!' },
],
});
console.log(response.choices[0].message.content);
// Streaming
const stream = await client.chat.completions.create({
model: 'gemini-3-flash',
messages: [{ role: 'user', content: 'Tell me a story.' }],
stream: true,
});
for await (const chunk of stream) {
process.stdout.write(chunk.choices[0]?.delta?.content || '');
}
from openai import OpenAI
client = OpenAI(
api_key="YOUR_EASY_PEASY_API_KEY",
base_url="https://easy-peasy.ai/api",
)
response = client.chat.completions.create(
model="gemini-3-flash",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"},
],
)
print(response.choices[0].message.content)
curl -X POST https://easy-peasy.ai/api/chat/completions \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"messages": [
{"role": "user", "content": "Hello!"}
],
"model": "gemini-3-flash"
}'
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 isgemini-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.
| Provider | Current model IDs |
|---|---|
gemini-3.8-flash, gemini-3.7-flash, gemini-3.6-flash, gemini-3.5-flash, gemini-3.1-pro, gemini-3-pro | |
| Anthropic | claude-opus-5, claude-sonnet-5, claude-fable-5, claude-fable-5-1, claude-opus-4-8, claude-opus-4-7, claude-opus-4-6, claude-opus-4-5, claude-sonnet-4-6, claude-sonnet-4-5, claude-haiku-4-5 |
| OpenAI | gpt-6-astra, gpt-6-astra-max, gpt-5.6-sol, gpt-5.6-sol-max, gpt-5.6-terra, gpt-5.6-terra-max, gpt-5.6-luna, gpt-5.6-luna-max, gpt-5.5-instant, gpt-5.5-thinking, gpt-5.5-pro, gpt-5.4-instant, gpt-5.4-thinking, gpt-5.4-pro, gpt-5, gpt-5-mini |
| DeepSeek | deepseek-v4-pro, deepseek-v4-flash |
| Moonshot | kimi-k3, kimi-k2.7-code, kimi-k2.6 |
| Z.ai | glm-5p3, glm-5p3-max, glm-5p3-flash, glm-5p2, glm-5p1, glm-5 |
| MiniMax | minimax-m3 |
| Meta | muse-spark-1.3, muse-spark-1.3-max |
| Qwen | qwen3p8-max |
| xAI | grok-4 |
| Legacy ID | Resolves to |
|---|---|
deepseek-v3, deepseek-r1, deepseek-chat, deepseek-reasoner | deepseek-v4-flash |
minimax-m2, minimax-m2p5, minimax-m2p7 | minimax-m3 |
kimi-k2.5, kimi-k2-thinking, kimi-k2-instruct | kimi-k2.6 |
meta-llama-3.3-70b, llama4-maverick-instruct-basic | muse-spark-1.3 |
qwen3p6-plus, qwen3p7-plus | qwen3p8-max |
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:const response = await client.chat.completions.create({
model: 'gemini-3-flash',
messages: [
{
role: 'user',
content: [
{ type: 'text', text: 'What do you see in this image?' },
{
type: 'image_url',
image_url: { url: 'https://example.com/photo.jpg' },
},
],
},
],
});
response = client.chat.completions.create(
model="gemini-3-flash",
messages=[
{
"role": "user",
"content": [
{"type": "text", "text": "What do you see in this image?"},
{
"type": "image_url",
"image_url": {"url": "https://example.com/photo.jpg"},
},
],
}
],
)
curl -X POST https://easy-peasy.ai/api/chat/completions \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"messages": [{
"role": "user",
"content": [
{"type": "text", "text": "What do you see?"},
{"type": "image_url", "image_url": {"url": "https://example.com/photo.jpg"}}
]
}]
}'
{
"type": "image_url",
"image_url": {
"url": "data:image/png;base64,iVBORw0KGgo..."
}
}
Audio Input
Send audio as base64-encoded data (mp3, wav, webm, mp4):{
"role": "user",
"content": [
{ "type": "text", "text": "Transcribe this audio." },
{
"type": "input_audio",
"input_audio": {
"data": "base64-encoded-audio-data...",
"format": "mp3"
}
}
]
}
Streaming
Whenstream: true, the response uses Server-Sent Events in OpenAI chunk format:
data: {"id":"chatcmpl-...","object":"chat.completion.chunk","created":...,"model":"gemini-3-flash","choices":[{"index":0,"delta":{"content":"Hello"},"finish_reason":null}]}
data: {"id":"chatcmpl-...","object":"chat.completion.chunk","created":...,"model":"gemini-3-flash","choices":[{"index":0,"delta":{},"finish_reason":"stop"}]}
data: [DONE]
Authorizations
API key for authentication. Get yours at https://easy-peasy.ai/settings/api
Body
Array of message objects for the conversation
1Show child attributes
Show child attributes
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.
"gemini-3.8-flash"
Enable Server-Sent Events streaming
Sampling temperature where supported by the chosen model. Some models ignore or reject custom values.
Maximum tokens to generate
Nucleus sampling parameter
Stop sequences
Was this page helpful?
