API REFERENCE
Introduction
Apiarium provides a unified REST API to access multiple AI models under a single API key. No need to manage separate accounts for OpenAI, Anthropic or other providers.
Base URL:
Authentication
All requests must include your API key in the Authorization header using the Bearer scheme.
You can find your API key in your dashboard. Keep it secret — never expose it in client-side code.
Errors
Apiarium uses standard HTTP status codes. All errors return a JSON object with an error field.
LLM — Text Generation
/llmGenerate text using GPT-4o-mini. Send a list of messages in OpenAI chat format and receive a completion.
Parameters
Example
Response
{
"content": "Brew the moment.",
"credits_used": 2,
"credits_remaining": 9998
}Image Generation
/imageGenerate images using DALL-E 3. Returns a URL to the generated image. Each image costs 100 credits.
Parameters
Example
Response
{
"url": "https://oaidalleapiprodscus.blob.core.windows.net/...",
"credits_used": 100,
"credits_remaining": 9900
}Text to Speech
/ttsConvert text to natural-sounding audio. Returns an MP3 audio stream. Costs 5 credits per 1,000 characters.
Parameters
Example
Response
Returns a binary MP3 audio stream with Content-Type: audio/mpeg. Headers include:
Content-Type: audio/mpeg X-Credits-Used: 5 X-Credits-Remaining: 9995
Transcription
/transcribeTranscribe audio to text using Whisper. Send an audio file as multipart/form-data. Costs 10 credits per minute of audio.
Parameters
Example
Response
{
"text": "Hello, this is a transcription of the audio file.",
"credits_used": 10,
"credits_remaining": 9990
}