Skip to content

Other endpoints

Reference for Anthropic Messages, OpenAI Responses, Embeddings, Images, Key inspection, and API capabilities on HeyEly.

HeyEly speaks the exact wire protocols your existing SDKs already expect. Swap the base URL and API key, and leave the rest of your application intact. Looking to configure an editor or CLI instead? Head to Coding tools.

OpenAI format
https://heyely.si/v1 Most SDKs and tools
Anthropic format
https://heyely.si Claude Code and the Anthropic SDK

Anthropic clients add /v1/messages themselves, so their base URL has no /v1. A doubled or missing /v1 returns 404.

Authenticate using either Authorization: Bearer sk-df-... or x-api-key: sk-df-.... See Authentication.

Which endpoint

EndpointFormatUse it for
POST /v1/chat/completionsOpenAI Chat CompletionsDefault choice for most SDKs and tools: text, vision, tools, JSON schemas, streaming
POST /v1/completionsOpenAI legacy CompletionsPrompt-based text completions on models that expose legacy support
POST /v1/messagesAnthropic MessagesClaude Code and official Anthropic SDKs
POST /v1/responsesOpenAI ResponsesCodex and clients using OpenAI's Responses API
POST /v1/embeddingsOpenAI EmbeddingsVector embeddings for semantic search and retrieval
POST /v1/imagesOpenRouter ImagesDedicated image generation models
GET /v1/modelsOpenAI list, extendedPublic catalog with IDs, rates, and capabilities (no key required)
GET /v1/keyHeyElyLive inspection of key spend, cap, and account credit

Every response

  • Every response across the six inference POST routes carries x-request-id, including errors. Once HeyEly opens a credit hold for a call, it appears in Credit and usage under that ID (even if the provider fails). Calls rejected before holding credit and GET calls are not logged there.
  • Successful non-streamed responses carry x-astra-cost in micro-dollars. When the response body includes a generation ID, that header is provisional pending reconciliation. Images never carry a generation ID, so reported image costs are final immediately; if an image succeeds with no reported cost, it remains unresolved and the header reads 0.
  • Error payloads follow OpenAI's schema everywhere except Messages, which returns Anthropic's error envelope. See Errors.
  • Any call accompanied by PAYMENT-SIGNATURE returns a base64 JSON PAYMENT-RESPONSE header once checked (whether succeeded or failed), containing either the Elysium settlement hash or an empty transaction when existing credit paid. See Pay per request with x402.

What HeyEly changes

  • Unrecognized request fields pass upstream so providers can ignore parameters a model does not implement. Routing overrides (models, fallbacks, route, provider) return 400 unsupported_parameter, as do plugins entries other than response-healing, file-parser with cloudflare-ai or native, or context-compression with enabled: false.
  • On Chat Completions and legacy Completions without an explicit output cap and without server tools, HeyEly may trim its default output cap so the hold fits your spendable balance. Explicit output caps you send are never lowered. Messages and Responses keep full output reservations and refuse requests whose holds exceed available credit.
  • Chat Completions, legacy Completions, Embeddings, and Images overwrite user with an irreversible account tag. Every endpoint normalizes non-canonical model IDs (including stripping trailing [1m]) to the catalog ID, and Messages clamps web_search max_uses. Otherwise Messages and Responses forward payloads intact.
  • HeyEly never persists prompts or model replies.

Limits

Keys allow up to 300 requests per minute and 8 concurrent in-flight requests. Accounts that have never added paid credit share a 20-requests-per-minute account-wide cap across keys. Read Rate limits.

Also in this reference

Messages

POST/v1/messages

Implements Anthropic's Messages wire format. Successful responses stream or return verbatim, while errors are normalized into Anthropic's error envelope (preserving valid Anthropic error types and client-facing wording). Payloads forward untouched aside from two gateway adjustments: normalizing non-catalog model IDs (stripping any trailing [1m]) and capping server-side web_search max_uses to the request's tool-step allowance. Configure Anthropic SDKs with https://heyely.si as the base URL (no /v1 suffix).

Send a request

curl https://heyely.si/v1/messages \
  -H "x-api-key: $HEYELY_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "anthropic/claude-sonnet-5.5",
    "max_tokens": 1024,
    "messages": [{ "role": "user", "content": "Say hello in one sentence." }]
  }'
{
  "id": "msg_01Ab3xQz9k",
  "type": "message",
  "role": "assistant",
  "model": "anthropic/claude-sonnet-5.5",
  "content": [{ "type": "text", "text": "Hello, nice to meet you." }],
  "stop_reason": "end_turn",
  "usage": { "input_tokens": 14, "output_tokens": 9 }
}

Headers

x-api-keystringrequired
Your HeyEly API key (Authorization: Bearer sk-df-... is also accepted).
anthropic-versionstring
Relayed upstream untouched; populated automatically by Anthropic SDKs.
anthropic-betastring
Relayed upstream untouched for any beta feature flags.

Request body

modelstringrequired
Catalog model ID, such as anthropic/claude-sonnet-5.5.
max_tokensinteger
Output token cap. Required when a model publishes no maximum output (omitting it returns 400 output_cap_required). Explicit values hold in full up to the model's maximum; omitting max_tokens reserves the model's entire published maximum output with no 32,768-token clamp, and HeyEly never injects an output cap of its own.
messagesarrayrequired
Alternating user and assistant turns with string or block-array content.
systemstring | array
System prompt; use block arrays to place cache_control markers.
streamboolean
Enable server-sent event streaming.
toolsarray
Tool definitions available to the model.
tool_choiceobject
Controls how the model selects tools.
temperaturenumber
Sampling temperature.
thinkingobject
Extended thinking configuration on supporting models.

Query parameters such as ?beta=true are safely ignored.

Credit held

HeyEly reserves credit for prompt tokens, the full max_tokens, and allowed web-search steps, and never reduces max_tokens on Messages. A web_search tool's max_uses is clamped to the request's tool-step budget (30 by default, reducible via max_tool_calls unless stop_server_tools_when is present, which pins the budget at 30). Omitted or invalid max_uses inherits that allowance.

If your available balance or key cap cannot cover the hold, Messages answers 402 with billing_error: pass a smaller max_tokens or add credit. Calls covered by free credit run within their eligible hold. Read Pricing.

Files and URLs

  • Models process PDFs and other files natively only when they declare file input; otherwise HeyEly responds 400 unsupported_parameter unless you enable the free parser via "plugins": [{ "id": "file-parser", "pdf": { "engine": "cloudflare-ai" } }].
  • Inline or URL-referenced files and URL-referenced images or videos reserve the larger of the text estimate and the model's context window (or 1,000,000 tokens if unknown).
  • Non-streamed calls time out after 5 minutes if response headers do not arrive or body transfer stalls, and at 15 minutes overall, returning 504 with error.type: timeout_error (OpenAI endpoints return error.code: upstream_timeout). Nothing is billed yet and the hold stays reserved in case upstream completed the work. Streams have no total duration cap, though the same 5-minute header/body stall limits apply: stalling before headers costs zero, while after headers any reported cost is charged plus OpenRouter's 5% platform fee with no HeyEly markup. Stream long generations to avoid the 15-minute ceiling.

Response

When prompt caching triggers, usage also includes cache_creation_input_tokens and cache_read_input_tokens.

Errors

Messages errors use Anthropic's envelope (type: "error") carrying HeyEly's request_id, mirrored in both x-request-id and request-id headers. See Errors.

Responses

POST/v1/responses

Implements OpenAI's Responses wire format. Once validated, payloads forward after normalizing non-catalog model IDs (and stripping trailing [1m]). Routing overrides (models, fallbacks, route, provider), paid plugins, tool types outside function, custom, and supported web search, x_search, and audio input all return 400 unsupported_parameter. Sending a file to a model lacking native file support also returns 400 unless "plugins": [{ "id": "file-parser", "pdf": { "engine": "cloudflare-ai" } }] is included. Responses is strictly stateless: include the full conversation history in input on every turn. Authenticate with Authorization: Bearer sk-df-....

Send a request

curl https://heyely.si/v1/responses \
  -H "Authorization: Bearer $HEYELY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "anthropic/claude-sonnet-5.5",
    "input": "Say hello in one sentence."
  }'

Request body

modelstringrequired
Catalog model ID.
inputstring | arrayrequired
Single text prompt or full array of conversation items.
instructionsstring
System-level instructions for the turn.
streamboolean
Enable server-sent event streaming (used by Codex).
toolsarray
Flat tool declarations available to the model.
max_output_tokensinteger
Output token limit, which also bounds the credit hold.
reasoningobject
Reasoning configuration on models that expose it.
storeboolean
Omit or set false; persisted server-side responses are unsupported and return 400.
previous_response_idstring
Unsupported; pass prior turns explicitly inside input.

Streaming

Responses streams terminate with response.completed, response.incomplete (detailing why in incomplete_details), response.failed, or an error event. Terminal events contain the final response payload and provider-reported usage. Codex waits for response.completed. Read Streaming events for the full sequence.

Models

Model behavior on Responses varies across upstream providers. If a specific model struggles with Codex-style Responses payloads, switch models. See Codex.

Embeddings

POST/v1/embeddings

Implements OpenAI's Embeddings format. Pass an embedding model ID (listed in GET /v1/models with embeddings under architecture.output_modalities) and authenticate with Authorization: Bearer sk-df-... or x-api-key.

Send a request

curl https://heyely.si/v1/embeddings \
  -H "Authorization: Bearer $HEYELY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/text-embedding-3-small",
    "input": "A ledger is a list of entries."
  }'
{
  "object": "list",
  "data": [{ "object": "embedding", "index": 0, "embedding": [0.0123, -0.0456] }],
  "model": "openai/text-embedding-3-small",
  "usage": { "prompt_tokens": 8, "total_tokens": 8 }
}

Request body

modelstringrequired
Embedding model ID.
inputstring | arrayrequired
Single string or batch array of strings to embed.
encoding_formatstring
float (default) returns numeric arrays; base64 returns encoded strings.
dimensionsinteger
Optional truncated vector length on supporting models.

HeyEly replaces any user field with an internal account tag.

Response

The vector above is abbreviated. Because embeddings run strictly on open models, responses carrying usage.cost bill that figure plus OpenRouter's 5% platform fee with zero HeyEly markup (final immediately if no generation ID is present, or provisional when one is). Without usage.cost, token counts paired with a generation ID produce a provisional estimate; lacking both leaves nothing billed yet while keeping the hold reserved. x-astra-cost reports the amount in micro-dollars.

Images

POST/v1/images

Generates images from a model ID and prompt, returning data entries containing either b64_json or a url. This route follows OpenRouter's Images schema rather than OpenAI's /v1/images/generations. Authenticate via Authorization: Bearer sk-df-... or x-api-key.

Find image generation models in GET /v1/models by filtering for image in architecture.output_modalities.

Send a request

curl https://heyely.si/v1/images \
  -H "Authorization: Bearer $HEYELY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "recraft/recraft-v4.1-flash",
    "prompt": "A lighthouse on a cliff at dawn, flat illustration",
    "n": 1
  }' | jq -r '.data[0].b64_json' | base64 --decode > lighthouse.png
{
  "created": 1760000000,
  "data": [{ "b64_json": "iVBORw0KGgo...", "media_type": "image/png" }],
  "usage": {
    "prompt_tokens": 0,
    "completion_tokens": 0,
    "total_tokens": 0,
    "cost": 0.007
  }
}

Request body

modelstringrequired
Image model ID.
promptstringrequired
Text description of the image to generate.
ninteger
Number of images to generate (integer from 1 to 10, defaulting to 1; out-of-range values return 400 invalid_parameter).
aspect_ratiostring
Ratio string such as 16:9 on supporting models.
resolutionstring
Named size such as 1K or 2K on supporting models.
sizestring
Pixel dimensions such as 1024x1024 where accepted.
qualitystring
Quality tier where offered by the model.
output_formatstring
png, jpeg, or webp on models supporting format selection.
input_referencesarray
Reference images for image-guided generation where supported.
streamboolean
Enable SSE partial-image streaming (supported by OpenAI image models only).

Extra fields pass upstream (and unsupported fields are ignored by the provider). models, fallbacks, route, and provider return 400 unsupported_parameter, along with any plugins entry other than response-healing, file-parser on cloudflare-ai or native, or context-compression with enabled: false. HeyEly replaces user with an account tag.

Response

Each item in data includes b64_json (truncated above) or url, plus media_type indicating the output format. Images execute on open models only, so usage.cost is the raw provider USD figure before OpenRouter's 5% platform fee. Your total billed amount appears in Credit and usage and in x-astra-cost (micro-dollars) on completed non-streamed calls.

Streaming

When stream: true is sent to a streaming image model, HeyEly relays image_generation.partial_image progress frames, a final image_generation.completed event containing the finished image and usage, and [DONE] (or an error event if generation fails).

Billing

  • Per requested image, HeyEly holds the maximum of $0.20, the catalog per-input-image price (pricing.image), and 8,192 tokens at the model's highest image-output token rate (not exposed in GET /v1/models), plus any per-request charge. Insufficient room returns 402; request fewer images or top up credit.
  • Completed images bill usage.cost plus OpenRouter's 5% platform fee with no HeyEly markup. Because image responses carry no generation ID, that charge finalizes immediately; if a successful response omits usage.cost, it stays unresolved with its hold reserved.
  • Failed image calls bill any provider-reported cost plus OpenRouter's 5% platform fee with zero markup (typically zero). A non-streamed timeout charges nothing yet and keeps its hold reserved, because the upstream provider may still have rendered the image.
  • Free credit never pays for images; accounts with only free credit receive 402 free_credit_not_eligible.

Limits

LimitValueWhen exceeded
Request body64 MB413 request_too_large
Time to generate120 seconds from upstream dispatch, including streamsNon-streamed calls return 504 upstream_timeout with hold reserved; streamed timeouts follow the rule below
Images per request10400 invalid_parameter

Because rendering can take longer than 60 seconds, configure client timeouts of at least 180 seconds.

A streamed timeout before response headers returns 504 upstream_timeout and costs zero. After headers, a timeout interrupts the HTTP 200 stream. A reported cost is charged plus OpenRouter's 5% platform fee. HeyEly adds no markup. Token counts with a generation id are a provisional estimate. Anything else does not charge the hold.

Also from chat

Multimodal chat models (such as Gemini and GPT image-capable models) can emit images directly inside chat completions by passing modalities: ["image", "text"] to Chat Completions. Dedicated image models like Recraft and FLUX require POST /v1/images.

Key

GET/v1/key

Inspects the active API key's spend, cap, and account credit balances, handy for status bars, CI guardrails, and monitoring scripts. Authenticate with Authorization: Bearer sk-df-... or x-api-key.

Send a request

curl https://heyely.si/v1/key \
  -H "Authorization: Bearer $HEYELY_API_KEY"

Response

{
  "data": {
    "name": "claude-code",
    "label": "sk-df-Ab3x...Qz9k",
    "limit": 50,
    "usage": 12.4,
    "limit_remaining": 37.6,
    "credit_available": 112.8,
    "free_credit_available": 1.25,
    "free_credit_expires_at": "2026-11-07T00:00:00.000Z",
    "expires_at": null
  }
}

Fields

namestring
User-assigned key name.
labelstring
Masked key identifier.
limitnumber | null
Configured spend limit in US dollars, or null if uncapped.
usagenumber
Cumulative US dollars spent by this key.
limit_remainingnumber | null
Remaining spend allowance (limit minus usage and active holds on this key, floored at 0), or null if uncapped.
credit_availablenumber
Spendable paid account credit in US dollars (balance minus active holds, floored at 0), excluding free credit.
free_credit_availablenumber
Spendable unexpired free credit in US dollars minus active holds (0 if none). See Free credit.
free_credit_expires_atstring | null
ISO 8601 timestamp of the earliest upcoming free credit expiration, or null if none applies.
expires_atstring | null
ISO 8601 key expiration timestamp, or null if non-expiring.

Errors

Invalid or disabled keys trigger the standard OpenAI-envelope authentication errors documented in Authentication.

Anthropic compatibility

POST /v1/messages implements Anthropic's Messages protocol. Because Claude Code and Anthropic's official SDKs append /v1/messages automatically, configure their base URL as https://heyely.si without /v1.

import anthropic

client = anthropic.Anthropic(
    base_url="https://heyely.si",
    api_key="sk-df-...",
)

message = client.messages.create(
    model="anthropic/claude-sonnet-5.5",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Say hello in one sentence."}],
)
print(message.content[0].text)

What passes through

  • anthropic-version and anthropic-beta headers pass straight through, and payloads keep Anthropic's exact structure including thinking and tool-use blocks.
  • SSE streams (including ping keepalives) relay chunk-by-chunk with zero buffering.
  • system and cache_control blocks stay untouched so Anthropic prompt caching works seamlessly.
  • Trailing query flags such as ?beta=true are ignored cleanly.
  • Client-side provider statuses (400, 403, 404, 408, 409, 413, 422, and 429) keep their HTTP code and are wrapped in Anthropic's error envelope, preserving valid Anthropic error types and client-facing messages while stripping provider internals. Non-standard bodies use HeyEly's mapped type and standard wording. Upstream 401 and 402 map to 503 overloaded_error; all other upstream errors map to 502 api_error. retry-after relays as integer seconds (HTTP-date values are dropped).
  • anthropic-ratelimit-* and x-should-retry headers forward whenever returned by the provider.

Choose a max_tokens value your available balance can hold, since HeyEly never lowers it on Messages. Server-run web_search tools cap max_uses at the request's tool-step allowance (up to 30, defaulting to that allowance when omitted). See Messages.

Credentials

Pass your key via x-api-key: sk-df-... (Anthropic SDK default) or Authorization: Bearer sk-df-... (sent by Claude Code when ANTHROPIC_AUTH_TOKEN is configured).

Model ids

Pass catalog IDs like anthropic/claude-sonnet-5.5. HeyEly accepts a trailing [1m] suffix, strips it before catalog lookup, and forwards the base catalog ID without [1m]. Non-Anthropic models are callable through Messages too, though extended thinking and tool blocks follow each model's native support.

Errors

Anthropic-format errors set type: "error", populate error.type and error.message, and stamp HeyEly's request_id (matching both x-request-id and request-id headers). Gateway 409 responses use conflict_error and gateway 504 responses use timeout_error. Read Errors.

Not available

POST /v1/messages/count_tokens is not exposed; Claude Code automatically switches to local token estimation when token counting is absent.

What your key can do

A single HeyEly API key unlocks every modality in the catalog. Pick a workflow below to copy a runnable request and jump straight to the matching reference section.

Every snippet reads HEYELY_API_KEY from your environment. Need a key first? Follow Quickstart.

Text

Send conversation turns and receive a reply, or add "stream": true for real-time token streaming.

curl https://heyely.si/v1/chat/completions \
  -H "Authorization: Bearer $HEYELY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek/deepseek-v3.2",
    "messages": [{ "role": "user", "content": "Explain a ledger in one sentence." }],
    "max_tokens": 200
  }'

Browse text models, or dive into Chat Completions and Streaming.

Vision

Include an image_url content part alongside your text prompt using either a public URL or a base64 data: URI.

curl https://heyely.si/v1/chat/completions \
  -H "Authorization: Bearer $HEYELY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "anthropic/claude-sonnet-5.5",
    "messages": [{
      "role": "user",
      "content": [
        { "type": "text", "text": "What is in this image?" },
        { "type": "image_url", "image_url": {
          "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/960px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"
        } }
      ]
    }],
    "max_tokens": 300
  }'

PNG, JPEG, WebP, and GIF inputs are accepted and metered as input tokens. Find vision-capable models by checking image in architecture.input_modalities via GET /v1/models.

Image generation

Call POST /v1/images with an image model and prompt to generate base64-encoded images (allow over a minute for rendering).

curl https://heyely.si/v1/images \
  -H "Authorization: Bearer $HEYELY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "recraft/recraft-v4.1-flash",
    "prompt": "A lighthouse on a cliff at dawn, flat illustration"
  }' | jq -r '.data[0].b64_json' | base64 --decode > lighthouse.png

Paid credit is required because free credit never covers image generation. Look for image in architecture.output_modalities on GET /v1/models, and read Images.

Embeddings

Convert text snippets into dense numerical vectors for indexing, clustering, and semantic retrieval.

curl https://heyely.si/v1/embeddings \
  -H "Authorization: Bearer $HEYELY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/text-embedding-3-small",
    "input": "A ledger is a list of entries."
  }'

Embedding models list embeddings under architecture.output_modalities in GET /v1/models. Read Embeddings.

Tool calling

Declare callable schemas inside tools. Whenever the model decides to invoke a function, it responds with structured tool_calls naming the function and its JSON arguments.

curl https://heyely.si/v1/chat/completions \
  -H "Authorization: Bearer $HEYELY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "anthropic/claude-sonnet-5.5",
    "messages": [{ "role": "user", "content": "What is the weather in Lisbon?" }],
    "tools": [{
      "type": "function",
      "function": {
        "name": "get_weather",
        "description": "Get the current weather for a city.",
        "parameters": {
          "type": "object",
          "properties": { "city": { "type": "string" } },
          "required": ["city"]
        }
      }
    }]
  }'

Models supporting function calling list tools inside supported_parameters on GET /v1/models. See Tool calling for returning results and completing the loop.

Structured outputs

Pass a JSON Schema inside response_format so replies conform cleanly to your expected object shape.

curl https://heyely.si/v1/chat/completions \
  -H "Authorization: Bearer $HEYELY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "anthropic/claude-sonnet-5.5",
    "messages": [{ "role": "user", "content": "Extract: Ada paid $12.40 on Oct 8." }],
    "response_format": {
      "type": "json_schema",
      "json_schema": {
        "name": "payment",
        "strict": true,
        "schema": {
          "type": "object",
          "properties": {
            "name": { "type": "string" },
            "amount_usd": { "type": "number" }
          },
          "required": ["name", "amount_usd"],
          "additionalProperties": false
        }
      }
    }
  }'

Verify that your chosen model exposes response_format or structured_outputs in its supported parameters, and read Structured outputs.

Reasoning

Reasoning-capable models work through intermediate steps before answering. Pass reasoning to tune thinking depth; internal thoughts arrive in message.reasoning and bill at the output token rate.

curl https://heyely.si/v1/chat/completions \
  -H "Authorization: Bearer $HEYELY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "anthropic/claude-sonnet-5.5",
    "messages": [{ "role": "user", "content": "Is 9.11 larger than 9.9?" }],
    "reasoning": { "effort": "high" },
    "max_tokens": 4000
  }'

Set effort to low, medium, or high, or pass an explicit token budget with reasoning.max_tokens. On POST /v1/messages, pass Anthropic's thinking object instead. Reasoning models advertise reasoning in supported_parameters on GET /v1/models.