ONE KEY. YOUR WORKFLOW.
OpenAI-compatible
API documentation.
Use text models through an OpenAI-compatible API. Set your base URL, add your key and choose a model.
https://aelder.dev/v101 / CONNECTION
Three settings. One connection.
- Create an API key. Create an account, add credit and create a key in your dashboard.
- Set the base URL. In an OpenAI-compatible tool, choose a custom provider or endpoint and enter
https://aelder.dev/v1. - Choose a model. Enter your key and the exact model ID returned by the models endpoint.
Set up the examples
The shell examples use Bash or Zsh. Replace the model ID below with one from the next section, then enter your key at the hidden prompt. You can also supply the key through your local secrets manager.
export AELDER_MODEL="MODEL_ID_FROM_LIST"
printf 'Service API key: '
IFS= read -r -s AELDER_API_KEY
printf '\n'
export AELDER_API_KEYFor HTTP requests, send Authorization: Bearer YOUR_API_KEY. For an SDK, pass the key itself, without the Bearer prefix.
02 / MODELS
Use the exact model ID.
Request the model list with your API key. Copy a value from data[].id into AELDER_MODEL. The list reflects the models configured for your account and key permissions.
curl "https://aelder.dev/v1/models" \
-H "Authorization: Bearer $AELDER_API_KEY"See models and prices to compare options. A model name alone does not guarantee support for every API format or optional parameter.
03 / TEXT GENERATION
Send your first request.
Chat Completions takes a model ID and a conversation in messages. This example sends one text message. For a conversation, include the previous user and assistant messages on each request.
curl "https://aelder.dev/v1/chat/completions" \
-H "Authorization: Bearer $AELDER_API_KEY" \
-H "Content-Type: application/json" \
-d @- <<EOF
{
"model": "$AELDER_MODEL",
"messages": [{"role": "user", "content": "Say hello in one sentence."}]
}
EOFPython · OpenAI SDK
Install with pip install openai. Run this code in the environment where you set the variables above.
import os
from openai import OpenAI
client = OpenAI(
base_url="https://aelder.dev/v1",
api_key=os.environ["AELDER_API_KEY"],
)
response = client.chat.completions.create(
model=os.environ["AELDER_MODEL"],
messages=[{"role": "user", "content": "Say hello in one sentence."}],
)
print(response.choices[0].message.content)JavaScript · OpenAI SDK
Install with npm install openai. Use this example in a Node.js ES module, such as example.mjs.
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://aelder.dev/v1",
apiKey: process.env.AELDER_API_KEY,
});
const response = await client.chat.completions.create({
model: process.env.AELDER_MODEL,
messages: [{ role: "user", content: "Say hello in one sentence." }],
});
console.log(response.choices[0].message.content);Read the response
For a plain text Chat Completions response, read choices[0].message.content. The usage object reports token counts when supplied by the model. Tool-call responses have a different structure.
Usage fields vary by model and format. Input, output, cached and reasoning tokens can be reported separately. Do not use total_tokens alone to estimate the charge; input and output rates can differ.
Optional parameters
Use stream: true for incremental output. Sampling settings, output-token limits, reasoning controls and tool calls depend on the model and API format. Start with the minimal request above and add the settings your model supports.
04 / API FORMATS
Match the format to your client.
These are different request formats. Use the format supported by both your tool and selected model.
| Format | HTTP endpoint | Request content |
|---|---|---|
| Chat Completions | POST /v1/chat/completions | messages |
| Responses | POST /v1/responses | input |
| Anthropic Messages | POST /v1/messages | messages and max_tokens |
Responses · minimal request
Choose a model that supports the Responses format. Read text from the response's output content items; it does not use Chat Completions' choices structure.
curl "https://aelder.dev/v1/responses" \
-H "Authorization: Bearer $AELDER_API_KEY" \
-H "Content-Type: application/json" \
-d @- <<EOF
{"model": "$AELDER_MODEL", "input": "Say hello."}
EOFAnthropic Messages · minimal request
Choose a model that supports Messages. Send your service key as x-api-key with the anthropic-version header. Read text from content blocks with type: "text". Other blocks, such as thinking or tool use, are not the final text answer.
curl "https://aelder.dev/v1/messages" \
-H "x-api-key: $AELDER_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d @- <<EOF
{
"model": "$AELDER_MODEL",
"max_tokens": 256,
"messages": [{"role": "user", "content": "Say hello."}]
}
EOFThis guide covers text requests. Support for a format does not imply support for every feature of the original vendor API.
05 / STREAMING
Read the answer as it arrives.
Add stream=True to the Python Chat Completions example. Keep the same imports and client setup.
stream = client.chat.completions.create(
model=os.environ["AELDER_MODEL"],
messages=[{"role": "user", "content": "Explain what an API is."}],
stream=True,
)
for chunk in stream:
if chunk.choices:
text = chunk.choices[0].delta.content
if text:
print(text, end="", flush=True)At the HTTP level, Chat Completions uses Server-Sent Events. Read text from choices[].delta.content; some chunks contain metadata or tool calls instead. A data: [DONE] event ends the stream. Usage-only chunks can have an empty choices array. Reasoning models may send reasoning before the final answer; allow enough output tokens for both.
Responses and Messages use their own event types. Use the matching SDK parser. A stream can fail after it starts, so handle interruptions as well as HTTP errors.
06 / TROUBLESHOOTING
Check the error message first.
The status code gives a starting point. The response body explains the specific problem; its wording and code can vary by model and request format.
400Check the request
Check the JSON, required fields and parameters supported by the selected model. Reduce the conversation length if it exceeds the context limit.
401Check your API key
Use a valid API key from your account. Check that it has not expired or been disabled, and that the Authorization header is present.
403Check access restrictions
Check the model permissions and IP restrictions on your key. Read the error message for the specific restriction.
404Check the address and model
Check the endpoint path and model ID. An SDK base URL and a complete request URL are different; avoid adding /v1 twice.
429Slow down requests
Reduce concurrency and use bounded retries with exponential backoff. Check the error message and any retry guidance before retrying.
5xxTemporary service error
Retry with a short delay and a limited number of attempts. Repeated generation requests may produce additional billable usage.
Balance or quota error?
Check your account balance, your key's spending limit and its expiry date in the dashboard. An account can have credit while an individual key has reached its own limit.
Model missing or not available?
Copy its exact ID from GET /v1/models, check your key's model permissions and confirm that the model supports your chosen endpoint.
Still stuck?
Keep the timestamp, model ID, endpoint, HTTP status and any request ID returned with the error. Use the support information in our FAQ to contact us. Never include your API key or private prompt content.
07 / TOOLS & AGENTS
Bring your own workflow.
Find your coding tool, chat app, SDK or framework in Connect other tools. Each guide covers the native settings, model selection, verification and relevant limitations.
Prefer a local dashboard that manages connections for supported tools? Connect through OpenCodex. Already using an agent? Follow the native setup for Hermes Agent or OpenClaw.
You can also connect directly: enter this service's base URL, API key and exact model ID in your tool's custom OpenAI-compatible settings. Check which API format the tool expects.
↑ Back to connection settings
