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)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)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)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)