Guides
LLM APIs
Claude, GPT and Gemini are reachable through one OpenAI-compatible Chat Completions endpoint, and through each vendor's own API. Requests and responses — streaming included — pass through exactly as the vendor defines them, so existing code and official SDKs work by changing only the base URL and the API key.
Endpoints
All on https://api.picsart.com. Point an SDK at the base URL; it appends the rest.
| API | Endpoint | SDK base URL |
|---|---|---|
| Chat Completions (all models) | POST /llm-proxy/openai/v1/chat/completions | /llm-proxy/openai/v1 |
| Anthropic Messages | POST /llm-proxy/claude/v1/messages | /llm-proxy/claude |
| OpenAI Responses | POST /llm-proxy/openai/v1/responses | /llm-proxy/openai/v1 |
| Gemini generateContent | POST /llm-proxy/gemini/v1beta/models/{model}:generateContent | /llm-proxy/gemini |
Authentication
Send your Picsart API key as Authorization: Bearer <key> (see Authentication). Any vendor credentials you send are ignored. The OpenAI SDK sends its key this way; with the Anthropic SDK pass it as auth_token / authToken; the Google Gen AI SDK needs the header set explicitly, as below.
Chat Completions — every model
One endpoint and one client for every text model, with the OpenAI SDK (pip install openai / npm install openai). The vendor is picked from the model id — claude-*, gemini-*, or an OpenAI model — so switching vendors means changing model.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["PICSART_API_KEY"],
base_url="https://api.picsart.com/llm-proxy/openai/v1",
)
completion = client.chat.completions.create(
model="claude-opus-4-8",
messages=[{"role": "user", "content": "Write a haiku about the ocean."}],
)
print(completion.choices[0].message.content)import OpenAI from 'openai';
const client = new OpenAI({
apiKey: process.env.PICSART_API_KEY,
baseURL: 'https://api.picsart.com/llm-proxy/openai/v1',
});
const completion = await client.chat.completions.create({
model: 'claude-opus-4-8',
messages: [{ role: 'user', content: 'Write a haiku about the ocean.' }],
});
console.log(completion.choices[0].message.content);curl -X POST 'https://api.picsart.com/llm-proxy/openai/v1/chat/completions' \
-H "Authorization: Bearer $PICSART_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-opus-4-8",
"messages": [
{
"role": "user",
"content": "Write a haiku about the ocean."
}
]
}'Anthropic — Messages
The native Messages API with the Anthropic SDK (pip install anthropic / npm install @anthropic-ai/sdk).
import os
import anthropic
client = anthropic.Anthropic(
auth_token=os.environ["PICSART_API_KEY"],
base_url="https://api.picsart.com/llm-proxy/claude",
)
message = client.messages.create(
model="claude-opus-4-8",
max_tokens=1024,
messages=[{"role": "user", "content": "Write a haiku about the ocean."}],
)
print(message.content[0].text)import Anthropic from '@anthropic-ai/sdk';
const client = new Anthropic({
authToken: process.env.PICSART_API_KEY,
baseURL: 'https://api.picsart.com/llm-proxy/claude',
});
const message = await client.messages.create({
model: 'claude-opus-4-8',
max_tokens: 1024,
messages: [{ role: 'user', content: 'Write a haiku about the ocean.' }],
});
for (const block of message.content) {
if (block.type === 'text') console.log(block.text);
}curl -X POST 'https://api.picsart.com/llm-proxy/claude/v1/messages' \
-H "Authorization: Bearer $PICSART_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-opus-4-8",
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": "Write a haiku about the ocean."
}
]
}'OpenAI — Responses
The native Responses API with the OpenAI SDK (pip install openai / npm install openai).
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["PICSART_API_KEY"],
base_url="https://api.picsart.com/llm-proxy/openai/v1",
)
response = client.responses.create(
model="gpt-5.1",
input="Write a haiku about the ocean.",
)
print(response.output_text)import OpenAI from 'openai';
const client = new OpenAI({
apiKey: process.env.PICSART_API_KEY,
baseURL: 'https://api.picsart.com/llm-proxy/openai/v1',
});
const response = await client.responses.create({
model: 'gpt-5.1',
input: 'Write a haiku about the ocean.',
});
console.log(response.output_text);curl -X POST 'https://api.picsart.com/llm-proxy/openai/v1/responses' \
-H "Authorization: Bearer $PICSART_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.1",
"input": "Write a haiku about the ocean."
}'Gemini — generateContent
The native generateContent API with the Google Gen AI SDK (pip install google-genai / npm install @google/genai).
import os
from google import genai
from google.genai import types
client = genai.Client(
api_key="unused", # the SDK requires one; your Picsart key goes in the header below
http_options=types.HttpOptions(
base_url="https://api.picsart.com/llm-proxy/gemini",
headers={"Authorization": f"Bearer {os.environ['PICSART_API_KEY']}"},
),
)
response = client.models.generate_content(
model="gemini-2.5-flash",
contents="Write a haiku about the ocean.",
)
print(response.text)import { GoogleGenAI } from '@google/genai';
const ai = new GoogleGenAI({
apiKey: 'unused', // the SDK requires one; your Picsart key goes in the header below
httpOptions: {
baseUrl: 'https://api.picsart.com/llm-proxy/gemini',
headers: { Authorization: `Bearer ${process.env.PICSART_API_KEY}` },
},
});
const response = await ai.models.generateContent({
model: 'gemini-2.5-flash',
contents: 'Write a haiku about the ocean.',
});
console.log(response.text);curl -X POST 'https://api.picsart.com/llm-proxy/gemini/v1beta/models/gemini-2.5-flash:generateContent' \
-H "Authorization: Bearer $PICSART_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [
{
"role": "user",
"parts": [
{
"text": "Write a haiku about the ocean."
}
]
}
]
}'