Endpoints and authentication
Base URL
Section titled “Base URL”https://api.openpalm.aiThe old address api.openpalmlab.com still works for now.
Clients differ in what they expect here. Some want the URL up to /v1, others want only the domain and add the path themselves. The pages under “Client setup” give the exact value for each client.
OpenAI-compatible endpoints
Section titled “OpenAI-compatible endpoints”Authentication: Authorization: Bearer sk-xxxx
| Method | Path | Notes |
|---|---|---|
POST |
/v1/chat/completions |
Chat Completions, streaming supported with "stream": true |
POST |
/v1/responses |
Responses API |
POST |
/v1/responses/compact |
Responses context compaction |
POST |
/v1/completions |
Legacy text completions |
POST |
/v1/embeddings |
Embeddings |
POST |
/v1/images/generations |
Image generation |
POST |
/v1/images/edits |
Image editing |
POST |
/v1/audio/speech |
Text to speech |
POST |
/v1/audio/transcriptions |
Speech to text |
POST |
/v1/audio/translations |
Speech translation to English (depends on what the site has enabled) |
POST |
/v1/rerank |
Reranking |
POST |
/v1/moderations |
Moderation |
GET |
/v1/models |
Models available to the current token |
GET |
/v1/models/{model} |
Look up one model |
An endpoint only works for a model if that model has an available channel in your group. The pricing page shows which endpoint types each model supports.
Realtime and asynchronous endpoints
Section titled “Realtime and asynchronous endpoints”These also use Authorization: Bearer sk-xxxx, but whether they work depends on which channels the site has enabled; availability depends on what the site has enabled. Check the model and endpoint type on the pricing page first.
| Method | Path | Notes |
|---|---|---|
GET |
/v1/responses |
Responses over WebSocket; send a response.create event after connecting |
GET |
/v1/realtime |
Realtime conversation (WebSocket) |
POST |
/v1/video/generations |
Submit a video generation task |
GET |
/v1/video/generations/{task_id} |
Fetch a video generation task |
POST |
/v1/videos/{video_id}/remix |
Generate again from an existing video |
POST |
/mj/submit/imagine and others |
Midjourney-compatible endpoints, all under /mj/; /mj/task/{id}/fetch fetches a task |
Endpoints that are not available
Section titled “Endpoints that are not available”/v1/files, /v1/fine-tunes and /v1/images/variations are not implemented by the gateway; requests to them return an error.
Anthropic-compatible endpoint
Section titled “Anthropic-compatible endpoint”| Method | Path | Notes |
|---|---|---|
POST |
/v1/messages |
Anthropic Messages API, streaming supported |
Either of these header styles works:
x-api-key: sk-xxxxanthropic-version: 2023-06-01Authorization: Bearer sk-xxxx/v1/messages/count_tokens is not available at the moment.
Gemini-compatible endpoints
Section titled “Gemini-compatible endpoints”| Method | Path | Notes |
|---|---|---|
POST |
/v1beta/models/{model}:generateContent |
Non-streaming generation |
POST |
/v1beta/models/{model}:streamGenerateContent |
Streaming generation |
GET |
/v1beta/models |
List models |
GET |
/v1beta/openai/models |
List models (OpenAI format) |
Send the key in an x-goog-api-key: sk-xxxx header, or as a ?key=sk-xxxx query parameter. Query parameters end up in proxy and server access logs, so the header is the better choice.
Authentication summary
Section titled “Authentication summary”| Header | Works with |
|---|---|
Authorization: Bearer sk-xxxx |
All endpoints |
x-api-key: sk-xxxx |
/v1/messages, /v1/models |
x-goog-api-key: sk-xxxx or ?key=sk-xxxx |
/v1beta/models/... |
The sk- prefix is optional; the token is accepted with or without it.
Request IDs
Section titled “Request IDs”When a request fails, the message field usually ends with (request id: ...). Include that ID when you contact support so we can find the request.