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/v1Most SDKs and tools- Anthropic format
https://heyely.siClaude 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: or x-api-key: sk-df-.... See Authentication.
Which endpoint
| Endpoint | Format | Use it for |
|---|---|---|
POST | OpenAI Chat Completions | Default choice for most SDKs and tools: text, vision, tools, JSON schemas, streaming |
POST /v1/completions | OpenAI legacy Completions | Prompt-based text completions on models that expose legacy support |
POST /v1/messages | Anthropic Messages | Claude Code and official Anthropic SDKs |
POST /v1/responses | OpenAI Responses | Codex and clients using OpenAI's Responses API |
POST /v1/embeddings | OpenAI Embeddings | Vector embeddings for semantic search and retrieval |
POST /v1/images | OpenRouter Images | Dedicated image generation models |
GET /v1/models | OpenAI list, extended | Public catalog with IDs, rates, and capabilities (no key required) |
GET /v1/key | HeyEly | Live inspection of key spend, cap, and account credit |
Every response
- Every response across the six inference
POSTroutes carriesx-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 andGETcalls are not logged there. - Successful non-streamed responses carry
x-astra-costin 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 reads0. - Error payloads follow OpenAI's schema everywhere except Messages, which returns Anthropic's error envelope. See Errors.
- Any call accompanied by
PAYMENT-SIGNATUREreturns a base64 JSONPAYMENT-RESPONSEheader 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) return400, as dounsupported_ parameter pluginsentries other thanresponse-healing,file-parserwithcloudflare-aiornative, orcontext-compressionwithenabled: 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
userwith an irreversible account tag. Every endpoint normalizes non-canonical model IDs (including stripping trailing[1m]) to the catalog ID, and Messages clampsweb_searchmax_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
- SDKs and clients: OpenAI, Anthropic, Vercel AI SDK, LiteLLM, and LangChain snippets
- Protocol compatibility: OpenAI and Anthropic
- Feature guides: Streaming, Tool calling, Structured outputs, and Prompt caching
- Docs for agents: fetch any page as Markdown or connect over MCP
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:is also accepted).Bearer sk-df-. . . 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; omittingmax_tokensreserves 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
userandassistantturns with string or block-array content. systemstring | array- System prompt; use block arrays to place
cache_controlmarkers. 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
fileinput; otherwise HeyEly responds400unless you enable the free parser viaunsupported_ parameter "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
504witherror.(OpenAI endpoints returntype: timeout_ error error.). 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.code: upstream_ timeout
Response
When prompt caching triggers, usage also includes cache_ 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 . Sending a file to a model lacking native file support also returns 400 unless "plugins": is included. Responses is strictly stateless: include the full conversation history in input on every turn. Authenticate with Authorization: .
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 return400. 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.) and authenticate with Authorization: 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_formatstringfloat(default) returns numeric arrays;base64returns 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: or x-api-key.
Find image generation models in GET /v1/models by filtering for image in architecture..
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:9on supporting models. resolutionstring- Named size such as
1Kor2Kon supporting models. sizestring- Pixel dimensions such as
1024x1024where accepted. qualitystring- Quality tier where offered by the model.
output_formatstringpng,jpeg, orwebpon 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 , 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_ progress frames, a final image_ 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 inGET /v1/models), plus any per-request charge. Insufficient room returns402; request fewer images or top up credit. - Completed images bill
usage.costplus OpenRouter's 5% platform fee with no HeyEly markup. Because image responses carry no generation ID, that charge finalizes immediately; if a successful response omitsusage.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
| Limit | Value | When exceeded |
|---|---|---|
| Request body | 64 MB | 413 request_too_large |
| Time to generate | 120 seconds from upstream dispatch, including streams | Non-streamed calls return 504 upstream_timeout with hold reserved; streamed timeouts follow the rule below |
| Images per request | 10 | 400 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: 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: 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
nullif uncapped. usagenumber- Cumulative US dollars spent by this key.
limit_remainingnumber | null- Remaining spend allowance (
limitminususageand active holds on this key, floored at0), ornullif 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 (
0if none). See Free credit. free_credit_expires_atstring | null- ISO 8601 timestamp of the earliest upcoming free credit expiration, or
nullif none applies. expires_atstring | null- ISO 8601 key expiration timestamp, or
nullif 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-versionandanthropic-betaheaders pass straight through, and payloads keep Anthropic's exact structure including thinking and tool-use blocks.- SSE streams (including
pingkeepalives) relay chunk-by-chunk with zero buffering. systemandcache_controlblocks stay untouched so Anthropic prompt caching works seamlessly.- Trailing query flags such as
?beta=trueare ignored cleanly. - Client-side provider statuses (
400,403,404,408,409,413,422, and429) 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. Upstream401and402map to503 overloaded_error; all other upstream errors map to502 api_error.retry-afterrelays as integer seconds (HTTP-date values are dropped). anthropic-ratelimit-*andx-should-retryheaders 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: (sent by Claude Code when ANTHROPIC_AUTH_TOKEN is configured).
Model ids
Pass catalog IDs like anthropic/. 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 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.
- TextChat Completions
- VisionChat Completions
- Image generationImages
- EmbeddingsEmbeddings
- Tool callingChat Completions
- Structured outputsChat Completions
- ReasoningChat Completions
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. 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. 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. 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.