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)
OpenAI-compatible chat completions endpoint. Works with the standard OpenAI SDK — just change the base URL and API key.
Supports text, vision (image URLs and base64), and audio input in the standard OpenAI multimodal message format. Supports both streaming (Server-Sent Events) and non-streaming responses.
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
This endpoint is fully compatible with the OpenAI SDK. Just change thebaseURL and apiKey:
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)
Supported Models
| Provider | Model ID | Description |
|---|---|---|
gemini-3-flash | Gemini 3 Flash — fast and efficient (default) | |
gemini-3-pro | Gemini 3 Pro — advanced reasoning | |
gemini-3.1-pro | Gemini 3.1 Pro — latest Gemini | |
| Anthropic | claude-opus-4-6 | Claude Opus 4.6 — most capable |
| Anthropic | claude-sonnet-4-6 | Claude Sonnet 4.6 — balanced |
| Anthropic | claude-haiku-4-5 | Claude Haiku 4.5 — fast |
| OpenAI | gpt-5 | GPT-5 — latest flagship |
| OpenAI | gpt-5-mini | GPT-5 Mini — smaller, fast |
| OpenAI | gpt-5.4-instant | GPT-5.4 Instant — fast |
| OpenAI | gpt-5.4-thinking | GPT-5.4 Thinking — reasoning |
| OpenAI | gpt-5.4-pro | GPT-5.4 Pro — most capable |
| DeepSeek | deepseek-v3 | DeepSeek V3 |
| Kimi | kimi-k2.5 | Kimi K2.5 |
| GLM | glm-5 | GLM-5 |
| MiniMax | minimax-m2p5 | MiniMax M2.5 |
| xAI | grok-4 | Grok 4 |
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: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
Headers
Your API key. Alternatively, use the Authorization: Bearer header.
Bearer token authentication (alternative to x-api-key). Format: Bearer YOUR_API_KEY
Body
Array of message objects for the conversation
Show child attributes
Show child attributes
Model to use for the completion. See the models table below for all supported models.
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 Enable Server-Sent Events streaming
Sampling temperature (0-2)
Maximum tokens to generate
Nucleus sampling parameter
Stop sequences
Was this page helpful?
