Avyneo API Integration Guide

Avyneo API supports the OpenAI, Google Gemini, and Anthropic compatible formats. Point an official SDK base URL at Avyneo and call Claude / Gemini / GPT and more without changing your application code.

Base URL
https://YOUR_AVYNEO_API_HOST/v1 · https://YOUR_AVYNEO_API_HOST/anthropic · https://YOUR_AVYNEO_API_HOST/gemini
Authentication
API Key (sk-avyneo-xxxxxx)
Protocols
Anthropic native (/anthropic/v1/messages) · OpenAI compatible (/v1/chat/completions) · Responses API (/v1/responses, GPT only) · Gemini native (/gemini/v1beta) · Images (/v1/images)

Replace sk-avyneo-xxxxxx in the examples with your own key. Keep it safe and never commit it to a repository.

1. Base URL & request headers

All three protocols share one API key; the Base URL differs per protocol:

base-urltext
OpenAI      https://YOUR_AVYNEO_API_HOST/v1
Anthropic   https://YOUR_AVYNEO_API_HOST/anthropic
Gemini      https://YOUR_AVYNEO_API_HOST/gemini

The authentication header depends on the protocol you call:

ProtocolHeader
Anthropicx-api-key: sk-avyneo-xxxxxx + anthropic-version: 2023-06-01
OpenAIAuthorization: Bearer sk-avyneo-xxxxxx
Geminix-goog-api-key: sk-avyneo-xxxxxx

2. Available models

Fetch the live list with GET /v1/models:

models.shbash
curl https://YOUR_AVYNEO_API_HOST/v1/models \
  -H "Authorization: Bearer sk-avyneo-xxxxxx"

Main models (excerpt):

VendorModel IDs
Anthropicclaude-fable-5, claude-opus-5, claude-sonnet-5, claude-opus-4-8, claude-sonnet-4-6, claude-haiku-4-5
OpenAIgpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna, gpt-5.5, gpt-5.4, gpt-5.4-mini, gpt-image-2
Googlegemini-3.7-flash, gemini-3.6-flash, gemini-3.5-flash, gemini-3.5-flash-lite, gemini-3.1-pro-preview
Kimikimi-k3
DeepSeekdeepseek-v4-pro, deepseek-v4-flash, deepseek-v4-flash-vision-exp
GLMglm-5.3-flash, glm-5.3, glm-5.2
Grokgrok-4.6

The table is an excerpt. The live /v1/models response is authoritative for availability and exact IDs.

3. Anthropic native format

Endpoint: POST /anthropic/v1/messages. Use this protocol for Claude models.

3.1 Basic request

messages.shbash
curl https://YOUR_AVYNEO_API_HOST/anthropic/v1/messages \
  -H "x-api-key: sk-avyneo-xxxxxx" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{
    "model": "claude-fable-5",
    "max_tokens": 1024,
    "messages": [
      {"role": "user", "content": "Introduce yourself in one sentence"}
    ]
  }'

Response (excerpt)

response.jsonjson
{
  "id": "msg_01KxDE...",
  "type": "message",
  "role": "assistant",
  "model": "claude-fable-5",
  "content": [{"type": "text", "text": "I am Claude..."}],
  "stop_reason": "end_turn",
  "usage": {"input_tokens": 159, "output_tokens": 34}
}

3.2 Streaming (SSE)

Add "stream": true; the response becomes text/event-stream:

messages-stream.shbash
curl https://YOUR_AVYNEO_API_HOST/anthropic/v1/messages \
  -H "x-api-key: sk-avyneo-xxxxxx" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{
    "model": "claude-fable-5",
    "max_tokens": 1024,
    "stream": true,
    "messages": [{"role": "user", "content": "Write a short poem"}]
  }'

Event sequence: message_start → content_block_start → multiple content_block_delta → content_block_stop → message_delta → message_stop.

3.3 Python SDK (anthropic)

claude.pypython
from anthropic import Anthropic

client = Anthropic(
    api_key="sk-avyneo-xxxxxx",
    base_url="https://YOUR_AVYNEO_API_HOST/anthropic",
)

resp = client.messages.create(
    model="claude-fable-5",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello"}],
)
print(resp.content[0].text)

Set the Anthropic SDK base_url to the /anthropic path — it appends /v1/messages itself.

4. OpenAI compatible format

Endpoints: POST /v1/chat/completions (Chat Completions) and POST /v1/responses (Responses API, GPT models only).

4.1 Chat Completions basic request

chat.shbash
curl https://YOUR_AVYNEO_API_HOST/v1/chat/completions \
  -H "Authorization: Bearer sk-avyneo-xxxxxx" \
  -H "content-type: application/json" \
  -d '{
    "model": "gpt-5.6-sol",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Hello"}]
  }'

The response is a standard OpenAI chat.completion object

response.jsonjson
{
  "object": "chat.completion",
  "model": "gpt-5.6-sol",
  "choices": [
    {"index": 0, "message": {"role": "assistant", "content": "Hello!"}, "finish_reason": "stop"}
  ],
  "usage": {"prompt_tokens": 214, "completion_tokens": 3, "total_tokens": 217}
}

4.2 Python SDK (openai)

gpt.pypython
from openai import OpenAI

client = OpenAI(
    api_key="sk-avyneo-xxxxxx",
    base_url="https://YOUR_AVYNEO_API_HOST/v1",
)

resp = client.chat.completions.create(
    model="gpt-5.6-sol",
    messages=[{"role": "user", "content": "Hello"}],
)
print(resp.choices[0].message.content)

The OpenAI SDK requires the /v1 suffix in base_url.

4.3 Streaming

Add "stream": true to receive standard OpenAI SSE (data: {...} chunks ending in data: [DONE]).

4.4 Responses API basic request

If your application has migrated to the OpenAI Responses API, call /v1/responses directly:

responses.shbash
curl https://YOUR_AVYNEO_API_HOST/v1/responses \
  -H "Authorization: Bearer sk-avyneo-xxxxxx" \
  -H "content-type: application/json" \
  -d '{
    "model": "gpt-5.6-sol",
    "input": "Introduce Avyneo in one sentence"
  }'

/v1/responses supports GPT models only; requesting Claude / Gemini returns 400. Use /v1/messages for Claude and the Gemini native format for Gemini.

4.5 Python SDK (openai responses)

responses.pypython
from openai import OpenAI

client = OpenAI(
    api_key="sk-avyneo-xxxxxx",
    base_url="https://YOUR_AVYNEO_API_HOST/v1",
)

resp = client.responses.create(
    model="gpt-5.6-sol",
    input="Introduce Avyneo in one sentence",
)
print(resp.output_text)

4.6 Responses API streaming

Add "stream": true to receive the standard Responses API streaming events.

4.7 Fast mode

The OpenAI-compatible endpoints support fast mode (formerly Priority processing). Add this to a Chat Completions or Responses API request:

fast-mode.jsonjson
"service_tier": "fast"
fast.pypython
from openai import OpenAI

client = OpenAI(
    api_key="sk-avyneo-xxxxxx",
    base_url="https://YOUR_AVYNEO_API_HOST/v1",
)

resp = client.responses.create(
    model="gpt-5.6-sol",
    input="Analyze this requirement for me",
    service_tier="fast",
)
print(resp.output_text)
fast.mjsjavascript
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: "sk-avyneo-xxxxxx",
  baseURL: "https://YOUR_AVYNEO_API_HOST/v1",
});

const resp = await client.responses.create({
  model: "gpt-5.6-sol",
  input: "Analyze this requirement for me",
  service_tier: "fast",
});
console.log(resp.output_text);

The legacy value "service_tier": "priority" is still accepted and behaves identically; fast is the recommended spelling for all GPT models that support fast mode.

Fast mode outputs faster and bills at a higher rate — see the pricing page. For GPT-5.6 and earlier, the response service_tier may still read "priority"; this is expected.

5. Gemini native format

Endpoint: POST /gemini/v1beta/models/{model}:generateContent.

5.1 Basic request

gemini.shbash
curl https://YOUR_AVYNEO_API_HOST/gemini/v1beta/models/gemini-3.5-flash:generateContent \
  -H "x-goog-api-key: sk-avyneo-xxxxxx" \
  -H "content-type: application/json" \
  -d '{
    "contents": [
      {"role": "user", "parts": [{"text": "Introduce yourself in one sentence"}]}
    ]
  }'

Response (excerpt)

response.jsonjson
{
  "candidates": [
    {
      "content": {"role": "model", "parts": [{"text": "I am Gemini..."}]},
      "finishReason": "STOP"
    }
  ],
  "usageMetadata": {"promptTokenCount": 12, "candidatesTokenCount": 22, "totalTokenCount": 34}
}

5.2 Streaming (SSE)

Use streamGenerateContent with alt=sse:

gemini-stream.shbash
curl "https://YOUR_AVYNEO_API_HOST/gemini/v1beta/models/gemini-3.5-flash:streamGenerateContent?alt=sse" \
  -H "x-goog-api-key: sk-avyneo-xxxxxx" \
  -H "content-type: application/json" \
  -d '{
    "contents": [
      {"role": "user", "parts": [{"text": "Write a short poem"}]}
    ]
  }'

5.3 Environment variables

If your tool or SDK supports a custom Gemini Base URL, configure it like this:

env.shbash
export GOOGLE_GEMINI_BASE_URL="https://YOUR_AVYNEO_API_HOST/gemini"
export GEMINI_API_KEY="sk-avyneo-xxxxxx"
export GEMINI_API_KEY_AUTH_MECHANISM="bearer"

Different Gemini SDKs name the custom endpoint field differently — commonly base_url, baseURL, apiEndpoint, or an environment variable. The principle: point the Base URL at your deployment and use your Avyneo API key.

6. Image generation (GPT Image 2)

The gpt-image-2 model uses the dedicated /v1/images endpoints with Authorization: Bearer authentication.

6.1 Generate an image

Endpoint: POST /v1/images/generations

images.shbash
curl https://YOUR_AVYNEO_API_HOST/v1/images/generations \
  -H "Authorization: Bearer sk-avyneo-xxxxxx" \
  -H "content-type: application/json" \
  -d '{
    "model": "gpt-image-2",
    "prompt": "An orange cat typing on a keyboard, illustration style"
  }'

Response (excerpt); data[0].b64_json is the Base64-encoded image

response.jsonjson
{
  "created": 1752345600,
  "data": [
    {"b64_json": "iVBORw0KGgo..."}
  ]
}

Set the client timeout to 300 seconds. Image models take much longer to respond; a short timeout may fail the call.

6.2 Edit an image

Endpoint: POST /v1/images/edits. Upload the source image via multipart/form-data with an edit instruction:

images-edit.shbash
curl https://YOUR_AVYNEO_API_HOST/v1/images/edits \
  -H "Authorization: Bearer sk-avyneo-xxxxxx" \
  -F model="gpt-image-2" \
  -F image="@photo.png" \
  -F prompt="Replace the background with a starry sky"

The endpoint is compatible with the OpenAI Images API.

7. Agent tool integration

Claude Code uses the Anthropic protocol, Codex uses OpenAI, and Gemini CLI uses Gemini. Point each tool at Avyneo with environment variables — no tool changes needed.

Claude Code (Anthropic protocol):

claude-code.shbash
export ANTHROPIC_BASE_URL="https://YOUR_AVYNEO_API_HOST/anthropic"
export ANTHROPIC_API_KEY="sk-avyneo-xxxxxx"

OpenAI-protocol tools (Chat Completions or Responses API):

openai-tools.shbash
export OPENAI_BASE_URL="https://YOUR_AVYNEO_API_HOST/v1"
export OPENAI_API_KEY="sk-avyneo-xxxxxx"

Gemini CLI:

gemini-cli.shbash
export GOOGLE_GEMINI_BASE_URL="https://YOUR_AVYNEO_API_HOST/gemini"
export GEMINI_API_KEY="sk-avyneo-xxxxxx"
export GEMINI_API_KEY_AUTH_MECHANISM="bearer"

8. FAQ

401 / authentication failure?
First check the protocol-to-header mapping: x-api-key for Anthropic, Authorization: Bearer for OpenAI, x-goog-api-key for Gemini. Then confirm the key was copied in full (sk-avyneo- prefix, no stray whitespace) and has not been deleted in the console. Also mind base_url: /v1 for OpenAI, /anthropic for Anthropic, /gemini for Gemini.
Which protocol should I use for Claude?
Configure agent tools such as Claude Code with the Anthropic protocol: /anthropic as the Base URL and /v1/messages as the endpoint. Other applications can keep calling Claude through the OpenAI-compatible format — the gateway translates the protocol at the edge.
Model unavailable?
Fetch the live list with GET /v1/models and check the spelling of the model ID (all lowercase; mind - vs .). Also confirm the endpoint matches the model.
Timeouts / slow first token?
Large models like Opus / Fable can take seconds to tens of seconds before the first token while thinking — this is normal, not a failure. In production, add "stream": true and raise the client read timeout.
Key security
Keep keys in environment variables or a secret manager. Never hardcode them, commit them to Git, or ship them in a client. If you suspect a leak, delete the key in the console immediately and create a replacement.