Eikr API Docs
Integrate Eikr's AI engine into your product. All requests are HTTPS, JSON in and out. Base URL: https://api.eikr.ee
Authentication
Every request to a protected endpoint must include your API key in the request header. API keys are issued after signing up for an API plan.
X-API-Key: eikr_your_api_key_here
Chat Endpoint
Send a message and receive an AI-generated response. Supports custom personas, conversation history, and per-user memory injection.
Request body
| Parameter | Type | Description |
|---|---|---|
| messagerequired | string | The user's message text |
| personalityoptional | string | System prompt / persona definition for the AI |
| historyoptional | array | Previous messages as [{role, content}] for context |
| user_idoptional | string | Your user identifier for memory persistence |
| languageoptional | string | Response language code e.g. "en", "es", "pt" |
const res = await fetch("https://api.eikr.ee/chat", { method: "POST", headers: { "X-API-Key": "eikr_your_key", "Content-Type": "application/json" }, body: JSON.stringify({ message: "What are your opening hours?", personality: "You are Sofia, support agent for Acme Store.", user_id: "user_123" }) });
{
"reply": "Hi! Our store is open Monday–Friday, 9am–6pm CET.",
"tokens_used": 84,
"model": "gpt-4o-mini"
}
Streaming Responses
For real-time chat experiences, use the streaming endpoint. Responses are delivered as Server-Sent Events (SSE). Same parameters as /chat.
const res = await fetch("https://api.eikr.ee/chat/stream", { method: "POST", headers: { "X-API-Key": "eikr_your_key", "Content-Type": "application/json" }, body: JSON.stringify({ message: "Tell me about Tallinn" }) }); const reader = res.body.getReader(); const decoder = new TextDecoder(); while (true) { const { done, value } = await reader.read(); if (done) break; const chunk = decoder.decode(value); process.stdout.write(chunk); // stream tokens as they arrive }
Voice Input
Transcribe a voice message (audio file) to text using Eikr's speech recognition pipeline.
Send audio as multipart/form-data with the file in the audio field. Supported formats: .ogg, .mp3, .wav, .m4a
{ "transcript": "What time do you close today?", "language": "en" }
Text-to-Speech
Convert a text string to an audio file. Useful for voice response loops.
| Parameter | Type | Description |
|---|---|---|
| textrequired | string | Text to convert to speech |
| voiceoptional | string | "alloy" (default), "nova", "echo", "fable", "onyx", "shimmer" |
| languageoptional | string | Language code for pronunciation |
Returns an audio/mpeg binary stream.
Vision / Image Analysis
Analyze an image and get an AI description or answer questions about it.
| Parameter | Type | Description |
|---|---|---|
| image_urlrequired* | string | Publicly accessible URL of the image |
| image_base64required* | string | Base64-encoded image (alternative to URL) |
| questionoptional | string | Specific question about the image |
* Provide either image_url or image_base64, not both.
Web Search
Get an AI-synthesized answer grounded in live web results. Useful for questions about current events, prices, or anything time-sensitive.
| Parameter | Type | Description |
|---|---|---|
| queryrequired | string | The search query or question |
| languageoptional | string | Response language code |
Error Codes
| Code | Meaning |
|---|---|
| 400 | Bad request — missing or invalid parameters |
| 401 | Unauthorized — missing or invalid API key |
| 429 | Rate limit exceeded — slow down requests |
| 500 | Internal server error — retry after a moment |
Rate Limits
Rate limits are applied per API key, based on your plan's monthly request allowance. Hitting a rate limit returns a 429 response.