Gateway API
Accly Gateway is a multi-model AI gateway API for accessing supported AI models through one Accly account. It supports familiar provider-compatible API formats where available, including OpenAI-compatible chat completions, Anthropic-style messages, and Google/Gemini-style generate content endpoints.
The primary quickstart path is the OpenAI-compatible chat completions endpoint. Use Accly API keys to call the gateway from your server, agent, automation, or backend application.
Base URL
https://api.accly.netEndpoint families
| Family | Endpoint | Key type | Status |
|---|---|---|---|
| OpenAI-compatible chat completions | POST /v1/chat/completions | openai or universal | Primary quickstart endpoint |
| OpenAI-compatible responses | POST /v1/responses | openai or universal | Used by Codex and Responses-compatible clients |
| Google/Gemini-style generate content | POST /v1/models/{model}:generateContent and POST /v1beta/models/{model}:generateContent | google | Endpoint-specific examples are not included on this page |
| Anthropic-style messages | Anthropic-style endpoint family | anthropic | Endpoint-specific examples are not included on this page |
Chat completions
/v1/chat/completionsFull URL:
https://api.accly.net/v1/chat/completionsAuthentication
Use an Accly API key in the Authorization header:
Authorization: Bearer sk-your-accly-api-keyFree accounts cannot create API keys. Gateway API access starts on paid plans.
Request body
The endpoint accepts a chat-completions style JSON body.
| Field | Type | Required | Notes |
|---|---|---|---|
model | string | Yes | Accly model ID available to your plan |
messages | array | Yes | Chat messages with role and content |
stream | boolean | No | Set true for server-sent event streaming |
max_tokens | number | No | Passed through and clamped if a plan max is configured |
temperature | number | No | Passed through to the selected model route |
top_p | number | No | Passed through to the selected model route |
n | number | No | Passed through when supported |
stop | array | No | Stop sequences |
Message content can be a string. Some supported models also accept vision-style content arrays. If a request includes image content for a model that does not support vision, the gateway returns vision_not_supported.
Request example
curl https://api.accly.net/v1/chat/completions \
-H "Authorization: Bearer sk-your-accly-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-opus-4-7",
"messages": [
{
"role": "user",
"content": "Write a short API integration checklist."
}
],
"stream": false
}'Streaming
Streaming is supported for chat completions.
Set stream to true:
{
"model": "claude-opus-4-7",
"messages": [
{
"role": "user",
"content": "Write a short onboarding email."
}
],
"stream": true
}The gateway returns OpenAI-compatible server-sent events.
Response body
Successful non-streaming responses use an OpenAI-compatible chat completion shape. Fields can vary by model response, but the response includes choices and may include usage.
{
"id": "chatcmpl_example",
"object": "chat.completion",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Start with authentication, send a small request, then add error handling and usage monitoring."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 24,
"completion_tokens": 17,
"total_tokens": 41
}
}The gateway also sets request correlation headers such as X-Request-ID and X-Accly-Request-ID.
Responses endpoint
/v1/responsesThe Responses-compatible endpoint is available for agents and clients that use OpenAI’s Responses API wire format. For Codex, configure the Accly base URL and let Codex append the request path itself.
Use an openai or universal key type for this endpoint. See Codex Setup for the complete Codex setup flow.
Error format
Gateway errors use this shape:
{
"error": {
"message": "Invalid API key.",
"type": "authentication_error",
"code": "invalid_api_key"
},
"request_id": "req_accly_1779290000000_0123456789abcdef"
}Use error.code for programmatic handling and keep request_id for support/debug correlation. The same request id is returned in X-Request-ID and X-Accly-Request-ID. See Errors & Limits for common codes.
TypeScript example
const response = await fetch('https://api.accly.net/v1/chat/completions', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.ACCLY_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
model: 'claude-opus-4-7',
messages: [
{
role: 'user',
content: 'Write a short API integration checklist.',
},
],
stream: false,
}),
})
if (!response.ok) {
const error = await response.json()
throw new Error(error.error?.message ?? 'Accly request failed')
}
const data = await response.json()
console.log(data.choices?.[0]?.message?.content)Python example
import os
import requests
response = requests.post(
"https://api.accly.net/v1/chat/completions",
headers={
"Authorization": f"Bearer {os.environ['ACCLY_API_KEY']}",
"Content-Type": "application/json",
},
json={
"model": "claude-opus-4-7",
"messages": [
{
"role": "user",
"content": "Write a short API integration checklist.",
}
],
"stream": False,
},
timeout=120,
)
if not response.ok:
error = response.json()
raise RuntimeError(error.get("error", {}).get("message", "Accly request failed"))
data = response.json()
print(data["choices"][0]["message"]["content"])