Daedalus by AstroVectAIBack to Daedalus

Daedalus API

Last updated November 15, 2026

Public HTTP API for Daedalus by AstroVectAI. Free and paid accounts can call Daedalus from their own projects with a personal API key.

This page covers /api/v1, how to create keys, limits, errors, and examples. Values in examples are placeholders unless noted.


Overview

The API uses the same chat and upload pipeline as the signed-in Daedalus app. Each request counts against your account’s plan, message or token limits, and allowed models. A personal key is not a separate quota; it acts as you.

Two programmatic endpoints exist under /api/v1:

MethodPathPurpose
POST/api/v1/chatSend a message (optionally with an image or video) and receive a reply
POST/api/v1/transcribeTranscribe a short audio recording to text

Create and revoke keys in Daedalus Settings, or with session-authenticated /me/api-keys routes (not with the dk_ key itself). See Creating and managing keys.


Authentication

Clients authenticate with a personal API key. Keys are issued by AstroVectAI, start with the prefix dk_, and are shown in full once at creation. After that, Daedalus stores only a hash, plus a short prefix and last four characters for display.

How to get a key

  1. Sign in at https://astrovect.online.
  2. Verify the email on the account. Unverified accounts cannot create keys or call /api/v1/chat.
  3. Open Settings and create a personal API key. You may give it a name (up to 80 characters).
  4. Copy the full key immediately and store it securely (for example an environment variable). It will not be shown again.

An account may have at most 5 active keys. Creating another returns an error until you revoke one.

Creating a key does not require a paid plan. Free accounts can create and use keys, subject to the free plan’s model and message limits. Image and video uploads and transcription require Plus or higher; see Plans, models, and limits.

How to send the key

Send the raw key in the Authorization header as a Bearer token:

HTTP
Authorization: Bearer dk_your_key

The key must start with dk_ and be at least 12 characters.

Do not put the key in the query string. Do not commit it to source control. If a key is leaked, revoke it in Settings and create a new one.


Base URL

text
https://astrovect.online

Example: https://astrovect.online/api/v1/chat

Use https://astrovect.online in clients. https://www.astrovect.online/ redirects to that host.

CORS

Cross-origin browser calls are not supported. Call the API from a server-side or local client, or proxy through your own origin.

Browser fetch from a different site will not receive a usable CORS grant. See Implementation guides.


Plans, models, and limits

Message and token quotas

POST /api/v1/chat charges the same usage pool as the website.

PlanQuotaReset
Free25 messages per dayMidnight America/New_York
Plus400 units per weekMonday 00:00 America/New_York
Premium, DevNo message cap—
Pilot, CommanderNo message cap; daily token budgets insteadMidnight America/New_York

Ordinary messages cost 1 unit. On Plus only, a reply that contains a generated HTML preview costs 2 units. When the pool is exhausted, the API returns 429 with limit_reached: true (see errors on /api/v1/chat).

Pilot and Commander use daily input/output token budgets rather than a message count. When that budget is exhausted, the API may return 429 with limit_reached: true.

Per-minute burst limits

These apply to every plan, including Premium.

EndpointWindowCapKeyed by
POST /api/v1/chatSliding 60 seconds20The API key
POST /api/v1/chat (account path)Sliding 60 seconds20The user account
POST /api/v1/transcribeSliding 60 seconds20The user account

When the burst cap is hit, the API returns 429:

JSON
{"error": "You're sending messages very quickly. Please wait a few seconds and try again.", "rate_limited": true}

Models

You may pass an optional model slug on POST /api/v1/chat. If you omit it, or send an unrecognized name, the server uses the plan’s default (the highest model included with that plan). If you request a model your plan does not include, the request fails with 403.

Public slugs and the plans that can use them:

SlugIncluded with
daedalus-1.0Free and above
daedalus-speechPlus and above
daedalus-1.1Plus and above
daedalus-1.2Premium, Dev, Pilot, Commander
daedalus-solPilot, Commander
daedalus-astraCommander

Accepted aliases (case-insensitive, spaces become hyphens) include 1.0, 1.1, 1.2, speech, voice, daedalus-voice, sol, pilot, astra, and commander. Unknown values are ignored and the plan default is used.

The model field in a successful chat response is a public display label (for example Daedalus 1.0, Daedalus 1.1, Daedalus 1.2, Daedalus Vision, Daedalus Speech, Pilot, or Commander), not necessarily the slug you sent.

Feature gates

FeatureRequirement
Text chatAny plan (email verified). Uses that plan’s models and quota.
Image or video on /api/v1/chatPlus, Premium, Dev, Pilot, or Commander. Otherwise 403.
/api/v1/transcribePlus or above (the plan must include daedalus-speech). Otherwise 403.

The 403 body for uploads is:

JSON
{"error": "File and image uploads require Plus ($4 for 30 days), Premium, or Dev."}

Pilot and Commander can also upload, even though that message names Plus, Premium, or Dev.

The 403 body for transcription is {"detail": "Talk is included with Plus and above."}.


Endpoints

POST /api/v1/chat

Send a message as the key’s account and receive a JSON reply. This is the primary programmatic endpoint. A typical request is a Bearer dk_ key and {"message":"Hello Daedalus"}.

Auth: personal API key (Authorization: Bearer dk_...). Email must be verified.

Request headers:

HeaderRequiredValue
AuthorizationYesBearer plus the personal API key
Content-TypeYesapplication/json

JSON body:

FieldTypeRequiredDescription
messagestringYes, unless image or video is sentThe user prompt. Leading/trailing whitespace is stripped.
conversation_idinteger or omittedNoExisting conversation owned by this account. If omitted, a new conversation is created.
modelstring or omittedNoPublic model slug or alias (see above). Defaults to the plan’s highest model.
imagestring or omittedNoA data:image/...;base64,... URL. Plus or higher required. If the value starts with data:video/ and video is empty, it is treated as video.
videostring or omittedNoA data:video/...;base64,... URL. Plus or higher required.
gameobject or omittedNoOptional JSON object for a short context snapshot. Most integrations should omit this. See note below.

At least one of message, image, or video must be non-empty after stripping. Otherwise the API returns 400 {"error": "Empty message"}.

There is no dedicated “message too long” error. Long prompts may be clipped when context is built: the latest turn can be clipped to 120,000 characters; older turns are shortened further. Speech-model history keeps the last 12 messages, each clipped to 1,500 characters.

Image format: a full data URL matching data:<mime>;base64,<payload>, where <mime> is an image type. Decoded size must be at most 20,971,520 bytes (20 MiB). Supported types include PNG, JPEG, WebP, GIF, BMP, TIFF, AVIF, ICO, and HEIC. Invalid data returns 400 with one of: image must be a data:image/...;base64 URL, invalid image data, image too large, or unsupported image type.

Video format: a full data URL matching data:<mime>;base64,<payload>. Decoded size must be at most 20,971,520 bytes. Accepted types include MP4, WebM, MOV, M4V, AVI, MPEG, and MPG. Invalid data returns 400 with one of: video must be a data:video/...;base64 URL, invalid video data, video too large, or unsupported video type.

game field: an optional JSON object. Lobby-style keys include in_room, map, zone, mode, player_count, and players. Extra properties are allowed. Most integrations should omit game.

Success response (HTTP 200): JSON with at least:

FieldTypeDescription
replystringThe assistant’s answer. Leftover UI status labels such as “Thinking…” are stripped. If no visible text was produced, this is I couldn't complete that reply. Please try again.
conversation_idintegerConversation to pass back on the next turn
modelstringPublic display label (may be empty)
actionsarrayUp to 4 objects, each either {"action": "<string>", "id": "<string>"} or {"type": "<string>", "value": "<string>"}. Empty for ordinary chat. Most clients can ignore this.
audiostring, only if presentA data:audio/...;base64,... URL. Included for Daedalus Speech (daedalus-speech, or aliases such as speech or voice) when text-to-speech succeeds. Ordinary text models do not include audio.

Website-only fields such as usage, trace, or busy are not copied into a successful API response.

Illustrative success body:

JSON
{
  "reply": "<assistant reply text>",
  "conversation_id": 12345,
  "model": "Daedalus 1.2",
  "actions": []
}

Errors:

StatusBody shapeWhen
401{"detail": "Invalid API key"}Missing, non-dk_, unknown, or revoked key; or a session token was sent
403{"detail": "Please verify your email first"}Email not verified
403{"detail": "This account is closed."}Account banned
403{"error": "...", "locked_model": "...", "allowed_models": [...], "upgrade": "..."}Requested model is not on the account’s plan. error is an upgrade hint such as Daedalus 1.2 is a Premium model. Upgrade to Premium to use it.
403{"error": "File and image uploads require Plus ($4 for 30 days), Premium, or Dev."}image or video sent on a plan that cannot upload
400{"error": "Empty message"}No message, image, or video
400{"error": "<decode error>"}Invalid image or video data URL (messages listed above)
404{"detail": "Chat not found"}conversation_id is not a conversation owned by this account
422{"error": "That request wasn't quite right. Please check it and try again."}JSON failed request validation (wrong types, malformed body)
429{"error": "You're sending messages very quickly. Please wait a few seconds and try again.", "rate_limited": true}Burst limit
429{"error": "<quota message>", "limit_reached": true, "upgrade": true, "usage": { ... }}Message or unit pool exhausted. See usage object below.
429{"error": "<token budget message>", "usage": { ... }, "limit_reached": true}Pilot or Commander daily token budget exhausted. See usage object below.
500{"error": "Could not start a chat."}A new conversation could not be created
500{"error": "Daedalus encountered a temporary issue processing that request. Please try again."}Failure inside the chat pipeline
500{"error": "Something went wrong. Please try again."}Unhandled server error
other 4xx/5xxJSON forwarded if present, otherwise {"error": "Request failed"}Other errors from chat or upload

Quota usage object (when limit_reached is true):

Example quota messages:

If backends are busy, the reply may be HTTP 200 with text Daedalus is busy right now, please try again in a minute. There is no separate busy flag.


POST /api/v1/transcribe

Transcribe a short recording to text. Used by the Daedalus Talk UI; also callable with a personal API key.

Auth: personal API key (Authorization: Bearer dk_...) or a signed-in session JWT. Email must be verified. The account plan must include daedalus-speech (Plus and above).

Request: one of two body formats.

1. Multipart form (Content-Type: multipart/form-data)

FieldRequiredDescription
file or audioYes (one of them)The audio file
formatNowav, webm, mp3, ogg, or m4a. If omitted, the file extension of the upload is used.

The official website client sends a WAV file in the file field.

2. JSON (Content-Type: application/json)

Either wrap the audio in input_audio, or send the same fields at the top level:

JSON
{
  "input_audio": {
    "format": "wav",
    "data": "<base64-encoded audio>"
  }
}
FieldRequiredDescription
formatYes (must be one of the allowed types)wav, webm, mp3, ogg, or m4a
data or audioYesStandard base64 of the audio bytes

Limits:

If the audio is valid but no speech is detected, the API returns HTTP 200 with {"text": ""} and does not call the transcription backend.

Success response (HTTP 200):

JSON
{"text": "<transcript>"}

text is a string (possibly empty). The illustrative value above is a placeholder.

Errors:

StatusBodyWhen
401{"detail": "Invalid API key"}dk_ key missing/invalid (when a dk_ prefix was sent)
401{"detail": "Not logged in"}No Bearer credentials, and no dk_ key
401{"detail": "Invalid token"}Bearer value is not a valid dk_ key and not a valid session JWT
403{"detail": "Please verify your email first"}Email not verified
403{"detail": "This account is closed."}Account banned
403{"detail": "Talk is included with Plus and above."}Plan does not include daedalus-speech
400{"detail": "Send a recording as an audio file or base64 audio."}Body could not be parsed as multipart audio or JSON base64 audio
400{"detail": "Use WAV, WebM, MP3, OGG, or M4A audio."}Format not in the allowed set
400{"detail": "That audio could not be read. Try recording again."}File/container could not be probed
413{"detail": "That recording is too large."}Raw request body over the intake cap
413{"detail": "Audio must be under 25 MB."}Decoded audio over 25 MiB
413{"detail": "Keep each recording under 60 seconds."}Duration over 60 seconds
429{"error": "You're sending messages very quickly. Please wait a few seconds and try again.", "rate_limited": true}Burst limit
503{"error": "Voice recognition is temporarily unavailable."}Transcription backend is not configured on the server
503{"detail": "Audio checking is temporarily unavailable. Try WAV audio."}Duration probe tooling is missing (non-WAV). WAV still works for probing.
502{"error": "I couldn't hear that clearly. Please try again."}Transcription backend failed

Creating and managing keys

The supported way to create a key is the Settings panel on astrovect.online.

The same operations are also exposed as HTTP routes on the account session (the Bearer token returned at login, not a dk_ key). These routes require a verified email.

GET /me/api-keys

List active (non-revoked) keys.

Auth: session JWT (Authorization: Bearer <session token>).

Success (200):

JSON
{
  "keys": [
    {
      "id": 1,
      "name": "API key",
      "prefix": "dk_xxxxxxx",
      "last4": "abcd",
      "created_at": "<ISO-8601 timestamp or null>",
      "last_used_at": "<ISO-8601 timestamp or null>"
    }
  ],
  "cap": 5
}

The full key is never returned on list. prefix is the first 10 characters of the key; last4 is the last 4. cap is the account’s key cap (default 5). id, name, and timestamps in the example are illustrative.

Without a session token: 401 {"detail": "Not logged in"}.

POST /me/api-keys

Create a key. Content-Type: application/x-www-form-urlencoded (or multipart form).

FieldTypeRequiredDescription
namestringNoLabel, trimmed and capped at 80 characters. Default if blank: API key.

Success (200): the public key fields plus key, the full plaintext, shown only this once:

JSON
{
  "id": 1,
  "name": "API key",
  "prefix": "dk_xxxxxxx",
  "last4": "abcd",
  "created_at": "<ISO-8601 timestamp or null>",
  "last_used_at": null,
  "key": "dk_your_key"
}

400 if the cap is reached, or if a key could not be minted:

JSON
{"error": "You can have at most 5 API keys. Revoke one to create another.", "cap": 5}

The number in that message matches the account’s key cap (default 5).

DELETE /me/api-keys/{key_id}

Revoke an active key owned by the signed-in user. key_id is the integer id from the list/create response.

Success (200): {"ok": true}

404: {"detail": "Not found"} if the key does not exist, is not yours, or is already revoked.

A revoked key immediately receives 401 {"detail": "Invalid API key"} on /api/v1/chat.


Error format notes

Two JSON shapes appear:

A request-validation failure on any JSON route is 422 with {"error": "That request wasn't quite right. Please check it and try again."}.


Implementation guides

Call the API from a server-side or local client. Browser JavaScript on another origin is blocked (see CORS).

curl
export DAEDALUS_API_KEY="dk_your_key"

curl https://astrovect.online/api/v1/chat \
  -H "Authorization: Bearer $DAEDALUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"message":"Hello Daedalus"}'

Continue a conversation (use the conversation_id returned by the first call):

curl
curl https://astrovect.online/api/v1/chat \
  -H "Authorization: Bearer $DAEDALUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"message":"Follow up question","conversation_id":12345,"model":"daedalus-1.2"}'

Transcribe a WAV file (Plus or higher):

curl
curl https://astrovect.online/api/v1/transcribe \
  -H "Authorization: Bearer $DAEDALUS_API_KEY" \
  -F "file=@recording.wav;type=audio/wav"
Python
import os
import requests

API = "https://astrovect.online"
KEY = os.environ["DAEDALUS_API_KEY"]  # e.g. dk_...
HEADERS = {
    "Authorization": f"Bearer {KEY}",
    "Content-Type": "application/json",
}

response = requests.post(
    f"{API}/api/v1/chat",
    headers=HEADERS,
    json={"message": "Hello Daedalus"},
    timeout=120,
)
response.raise_for_status()
data = response.json()
print(data["reply"])
conversation_id = data["conversation_id"]

# Next turn in the same conversation
follow = requests.post(
    f"{API}/api/v1/chat",
    headers=HEADERS,
    json={
        "message": "Follow up question",
        "conversation_id": conversation_id,
        "model": "daedalus-1.2",  # optional; must be allowed for your plan
    },
    timeout=120,
)
follow.raise_for_status()
print(follow.json()["reply"])

Send an image (Plus or higher). The image value must be a data:image/...;base64, URL:

Python
import base64

with open("photo.png", "rb") as fh:
    encoded = base64.b64encode(fh.read()).decode("ascii")

response = requests.post(
    f"{API}/api/v1/chat",
    headers=HEADERS,
    json={
        "message": "What is in this image?",
        "image": f"data:image/png;base64,{encoded}",
        "conversation_id": conversation_id,
    },
    timeout=120,
)

Transcribe (Plus or higher):

Python
with open("recording.wav", "rb") as fh:
    tr = requests.post(
        f"{API}/api/v1/transcribe",
        headers={"Authorization": f"Bearer {KEY}"},
        files={"file": ("recording.wav", fh, "audio/wav")},
        timeout=60,
    )
print(tr.json().get("text"))

Handle common errors:

Python
if response.status_code == 401:
    # {"detail": "Invalid API key"}
    ...
elif response.status_code == 429:
    body = response.json()
    if body.get("rate_limited"):
        ...  # slow down
    elif body.get("limit_reached"):
        ...  # plan quota; see body["error"] and body.get("usage")

Cross-origin browser fetch is not supported (see CORS above). Server-side fetch (Node.js, Deno, and similar) is unaffected.

JavaScript
const API = "https://astrovect.online";
const KEY = process.env.DAEDALUS_API_KEY; // dk_...

const response = await fetch(`${API}/api/v1/chat`, {
  method: "POST",
  headers: {
    Authorization: `Bearer ${KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ message: "Hello Daedalus" }),
});

if (!response.ok) {
  const err = await response.json().catch(() => ({}));
  throw new Error(err.detail || err.error || `HTTP ${response.status}`);
}

const data = await response.json();
console.log(data.reply);
const conversationId = data.conversation_id;

const follow = await fetch(`${API}/api/v1/chat`, {
  method: "POST",
  headers: {
    Authorization: `Bearer ${KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    message: "Follow up question",
    conversation_id: conversationId,
  }),
});

Transcribe with FormData (Plus or higher):

JavaScript
const form = new FormData();
form.append("file", wavBlob, "speech.wav"); // or a file from disk in Node.js

const tr = await fetch(`${API}/api/v1/transcribe`, {
  method: "POST",
  headers: { Authorization: `Bearer ${KEY}` },
  body: form,
});
const transcript = await tr.json();
console.log(transcript.text);
Go
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"net/http"
	"os"
	"time"
)

func main() {
	key := os.Getenv("DAEDALUS_API_KEY") // dk_...
	body, _ := json.Marshal(map[string]string{"message": "Hello Daedalus"})

	req, _ := http.NewRequest(http.MethodPost, "https://astrovect.online/api/v1/chat", bytes.NewReader(body))
	req.Header.Set("Authorization", "Bearer "+key)
	req.Header.Set("Content-Type", "application/json")

	client := &http.Client{Timeout: 120 * time.Second}
	resp, err := client.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()

	var out struct {
		Reply          string `json:"reply"`
		ConversationID int    `json:"conversation_id"`
		Model          string `json:"model"`
		Error          string `json:"error"`
		Detail         string `json:"detail"`
	}
	if err := json.NewDecoder(resp.Body).Decode(&out); err != nil {
		panic(err)
	}
	if resp.StatusCode >= 400 {
		panic(fmt.Sprintf("%d %s%s", resp.StatusCode, out.Detail, out.Error))
	}
	fmt.Println(out.Reply)
}

To continue a conversation, POST the same path with message and conversation_id (integer).

PHP
<?php
$key = getenv('DAEDALUS_API_KEY'); // dk_...

$ch = curl_init('https://astrovect.online/api/v1/chat');
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . $key,
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode(['message' => 'Hello Daedalus']),
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT => 120,
]);
$raw = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

$data = json_decode($raw, true);
if ($status >= 400) {
    throw new RuntimeException($data['detail'] ?? $data['error'] ?? "HTTP $status");
}
echo $data['reply'], PHP_EOL;
$conversationId = $data['conversation_id'];
Ruby
require "json"
require "net/http"
require "uri"

key = ENV.fetch("DAEDALUS_API_KEY") # dk_...
uri = URI("https://astrovect.online/api/v1/chat")

http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
http.read_timeout = 120

req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer #{key}"
req["Content-Type"] = "application/json"
req.body = JSON.generate({ "message" => "Hello Daedalus" })

res = http.request(req)
data = JSON.parse(res.body)
raise (data["detail"] || data["error"] || "HTTP #{res.code}") unless res.is_a?(Net::HTTPSuccess)

puts data["reply"]
conversation_id = data["conversation_id"]
C#
using System.Net.Http.Headers;
using System.Net.Http.Json;
using System.Text.Json.Serialization;

var key = Environment.GetEnvironmentVariable("DAEDALUS_API_KEY"); // dk_...
using var client = new HttpClient { Timeout = TimeSpan.FromSeconds(120) };
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", key);

var response = await client.PostAsJsonAsync(
    "https://astrovect.online/api/v1/chat",
    new { message = "Hello Daedalus" });

var data = await response.Content.ReadFromJsonAsync<ChatResponse>();
if (!response.IsSuccessStatusCode)
    throw new Exception(data?.Detail ?? data?.Error ?? $"HTTP {(int)response.StatusCode}");

Console.WriteLine(data!.Reply);
var conversationId = data.ConversationId;

record ChatResponse(
    [property: JsonPropertyName("reply")] string? Reply,
    [property: JsonPropertyName("conversation_id")] int ConversationId,
    [property: JsonPropertyName("model")] string? Model,
    [property: JsonPropertyName("error")] string? Error,
    [property: JsonPropertyName("detail")] string? Detail);
Java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;

String key = System.getenv("DAEDALUS_API_KEY"); // dk_...

HttpClient client = HttpClient.newBuilder()
    .connectTimeout(Duration.ofSeconds(30))
    .build();

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://astrovect.online/api/v1/chat"))
    .timeout(Duration.ofSeconds(120))
    .header("Authorization", "Bearer " + key)
    .header("Content-Type", "application/json")
    .POST(HttpRequest.BodyPublishers.ofString("{\"message\":\"Hello Daedalus\"}"))
    .build();

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() >= 400) {
    throw new RuntimeException("HTTP " + response.statusCode() + " " + response.body());
}
System.out.println(response.body()); // JSON with reply, conversation_id, model, actions

Add the crates to Cargo.toml. The example uses tokio. If you prefer not to use an async runtime, enable reqwest’s blocking feature and call reqwest::blocking::Client with .send() instead of .send().await.

TOML
[dependencies]
reqwest = { version = "0.12", features = ["json"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
Rust
use serde::Deserialize;
use std::env;
use std::time::Duration;

#[derive(Deserialize)]
struct ChatResponse {
    reply: Option<String>,
    conversation_id: Option<i64>,
    model: Option<String>,
    error: Option<String>,
    detail: Option<String>,
}

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let key = env::var("DAEDALUS_API_KEY")?; // dk_...
    let client = reqwest::Client::builder()
        .timeout(Duration::from_secs(120))
        .build()?;

    let response = client
        .post("https://astrovect.online/api/v1/chat")
        .header("Authorization", format!("Bearer {key}"))
        .json(&serde_json::json!({ "message": "Hello Daedalus" }))
        .send()
        .await?;

    let status = response.status();
    let data: ChatResponse = response.json().await?;
    if !status.is_success() {
        let msg = data
            .detail
            .or(data.error)
            .unwrap_or_else(|| format!("HTTP {status}"));
        return Err(msg.into());
    }

    println!("{}", data.reply.unwrap_or_default());
    let conversation_id = data.conversation_id;

    // Next turn: POST the same path with message and conversation_id (integer).
    let mut follow_body = serde_json::json!({ "message": "Follow up question" });
    if let Some(id) = conversation_id {
        follow_body["conversation_id"] = id.into();
    }
    let follow = client
        .post("https://astrovect.online/api/v1/chat")
        .header("Authorization", format!("Bearer {key}"))
        .json(&follow_body)
        .send()
        .await?;
    let follow_data: ChatResponse = follow.json().await?;
    println!("{}", follow_data.reply.unwrap_or_default());
    Ok(())
}

Run with DAEDALUS_API_KEY=dk_your_key cargo run. There is no official Daedalus Rust crate; use reqwest (or any HTTPS client) directly.

Build the JSON body with a library such as cJSON. Do not assemble JSON with sprintf if the message can contain quotes or other characters that must be escaped.

Install the development packages (Debian/Ubuntu names shown; Homebrew is curl and cjson), then compile and run:

curl
sudo apt-get install libcurl4-openssl-dev libcjson-dev
cc -o chat chat.c -lcurl -lcjson
DAEDALUS_API_KEY=dk_your_key ./chat

The cJSON header is often <cjson/cJSON.h>; some installs use <cJSON.h>.

C
#include <curl/curl.h>
#include <cjson/cJSON.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

struct memory {
    char *data;
    size_t size;
};

static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata)
{
    size_t total = size * nmemb;
    struct memory *mem = userdata;
    char *buf = realloc(mem->data, mem->size + total + 1);
    if (!buf)
        return 0;
    mem->data = buf;
    memcpy(mem->data + mem->size, ptr, total);
    mem->size += total;
    mem->data[mem->size] = '\0';
    return total;
}

int main(void)
{
    const char *key = getenv("DAEDALUS_API_KEY"); /* dk_... */
    if (!key || !key[0]) {
        fprintf(stderr, "DAEDALUS_API_KEY is not set\n");
        return 1;
    }

    cJSON *body = cJSON_CreateObject();
    cJSON_AddStringToObject(body, "message", "Hello Daedalus");
    char *payload = cJSON_PrintUnformatted(body);
    cJSON_Delete(body);
    if (!payload)
        return 1;

    size_t auth_len = strlen("Authorization: Bearer ") + strlen(key) + 1;
    char *auth = malloc(auth_len);
    if (!auth) {
        cJSON_free(payload);
        return 1;
    }
    snprintf(auth, auth_len, "Authorization: Bearer %s", key);

    struct memory chunk = {0};
    CURL *curl = curl_easy_init();
    if (!curl) {
        free(auth);
        cJSON_free(payload);
        fprintf(stderr, "curl_easy_init failed\n");
        return 1;
    }
    struct curl_slist *headers = NULL;
    headers = curl_slist_append(headers, auth);
    headers = curl_slist_append(headers, "Content-Type: application/json");

    curl_easy_setopt(curl, CURLOPT_URL, "https://astrovect.online/api/v1/chat");
    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
    curl_easy_setopt(curl, CURLOPT_POSTFIELDS, payload);
    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
    curl_easy_setopt(curl, CURLOPT_WRITEDATA, &chunk);
    curl_easy_setopt(curl, CURLOPT_TIMEOUT, 120L);

    CURLcode rc = curl_easy_perform(curl);
    long status = 0;
    curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);

    int exit_code = 0;
    if (rc != CURLE_OK) {
        fprintf(stderr, "%s\n", curl_easy_strerror(rc));
        exit_code = 1;
    } else {
        cJSON *data = cJSON_Parse(chunk.data ? chunk.data : "");
        if (status >= 400) {
            cJSON *detail = cJSON_GetObjectItemCaseSensitive(data, "detail");
            cJSON *error = cJSON_GetObjectItemCaseSensitive(data, "error");
            const char *msg = cJSON_IsString(detail) ? detail->valuestring
                            : cJSON_IsString(error)  ? error->valuestring
                                                     : "request failed";
            fprintf(stderr, "HTTP %ld %s\n", status, msg);
            exit_code = 1;
        } else {
            cJSON *reply = cJSON_GetObjectItemCaseSensitive(data, "reply");
            if (cJSON_IsString(reply) && reply->valuestring)
                puts(reply->valuestring);
            /* Next turn: POST message and conversation_id (integer). */
        }
        cJSON_Delete(data);
    }

    free(chunk.data);
    curl_slist_free_all(headers);
    curl_easy_cleanup(curl);
    free(auth);
    cJSON_free(payload);
    return exit_code;
}

This uses cpr (a C++ wrapper around libcurl) and nlohmann/json. You can also call libcurl directly, as in the C example, and parse the body with nlohmann/json.

A typical install is vcpkg install cpr nlohmann-json, or system packages such as libcpr-dev and nlohmann-json3-dev where available. Compile with C++17 or later, then run:

curl
c++ -std=c++17 -o chat chat.cpp -lcpr
DAEDALUS_API_KEY=dk_your_key ./chat

If you use CMake with vcpkg, link cpr::cpr and nlohmann_json::nlohmann_json.

C++
#include <cpr/cpr.h>
#include <nlohmann/json.hpp>

#include <cstdlib>
#include <iostream>
#include <stdexcept>
#include <string>

int main()
{
    const char *key = std::getenv("DAEDALUS_API_KEY"); // dk_...
    if (!key || !key[0])
        throw std::runtime_error("DAEDALUS_API_KEY is not set");

    nlohmann::json body = {{"message", "Hello Daedalus"}};
    cpr::Response response = cpr::Post(
        cpr::Url{"https://astrovect.online/api/v1/chat"},
        cpr::Header{
            {"Authorization", std::string("Bearer ") + key},
            {"Content-Type", "application/json"},
        },
        cpr::Body{body.dump()},
        cpr::Timeout{120000}); // milliseconds

    auto data = nlohmann::json::parse(response.text);
    if (response.status_code >= 400) {
        std::string msg = "HTTP " + std::to_string(response.status_code);
        if (data.contains("detail") && data["detail"].is_string())
            msg = data["detail"].get<std::string>();
        else if (data.contains("error") && data["error"].is_string())
            msg = data["error"].get<std::string>();
        throw std::runtime_error(msg);
    }

    std::cout << data.value("reply", "") << std::endl;
    int conversation_id = data.value("conversation_id", 0);
    // Next turn: POST the same path with message and conversation_id (integer).
    (void)conversation_id;
}

Lua does not include HTTPS in the standard library. Install LuaSocket, LuaSec (ssl.https), and a JSON library such as dkjson (or lua-cjson):

curl
luarocks install luasec
luarocks install dkjson
DAEDALUS_API_KEY=dk_your_key lua chat.lua

luasec pulls in LuaSocket. The lua-requests library is an optional wrapper around the same stack; the example below uses ssl.https directly so the headers and body are explicit.

Lua
local https = require("ssl.https")
local ltn12 = require("ltn12")
local json = require("dkjson")

local key = os.getenv("DAEDALUS_API_KEY") -- dk_...
if not key or key == "" then
  error("DAEDALUS_API_KEY is not set")
end

https.TIMEOUT = 120

local payload = json.encode({ message = "Hello Daedalus" })
local chunks = {}
local ok, status = https.request({
  url = "https://astrovect.online/api/v1/chat",
  method = "POST",
  headers = {
    ["Authorization"] = "Bearer " .. key,
    ["Content-Type"] = "application/json",
    ["Content-Length"] = tostring(#payload),
  },
  source = ltn12.source.string(payload),
  sink = ltn12.sink.table(chunks),
})

local data = json.decode(table.concat(chunks))
if not ok or (type(status) == "number" and status >= 400) then
  local msg = (data and (data.detail or data.error))
    or (ok and ("HTTP " .. tostring(status)) or tostring(status))
  error(msg)
end

print(data.reply)
local conversation_id = data.conversation_id
-- Next turn: POST the same path with message and conversation_id (integer).

Call the API from a server Script (for example in ServerScriptService) with HttpService:RequestAsync. This will not work in a LocalScript or any other client-side context.

Before it can run:

  • In Roblox Studio, enable Game Settings → Security → Allow HTTP Requests.
  • Keep the dk_ key off the client. Do not put it in LocalScripts, ReplicatedStorage, or any ModuleScript the client can require. Anyone who joins the game can read client-replicated code.
  • Prefer storing the key as a Roblox Secret and loading it with HttpService:GetSecret. Set the secret’s allowed domain to astrovect.online. Use Secret:AddPrefix("Bearer ") for the header so the key is never concatenated as a plain string. Secrets are not available during local playtesting unless you also add a Local Secret under File → Experience Settings → Security. If Secrets are not available, keep the key only in a server-only Script and rotate it if the place file leaks.
  • Roblox applies its own HTTP timeout, which may be shorter than the 120-second timeouts in the other examples. A slow model reply can fail even though the Daedalus request would otherwise succeed.
  • There is no official Daedalus Roblox SDK; use HttpService directly.
Lua
local HttpService = game:GetService("HttpService")

-- Create an experience Secret named DAEDALUS_API_KEY (the dk_ value), domain astrovect.online.
local key = HttpService:GetSecret("DAEDALUS_API_KEY")

local function chat(message: string, conversationId: number?, model: string?): any
	local body: { [string]: any } = { message = message }
	if conversationId ~= nil then
		body.conversation_id = conversationId
	end
	if model ~= nil then
		body.model = model
	end

	local response = HttpService:RequestAsync({
		Url = "https://astrovect.online/api/v1/chat",
		Method = "POST",
		Headers = {
			["Authorization"] = key:AddPrefix("Bearer "),
			["Content-Type"] = "application/json",
		},
		Body = HttpService:JSONEncode(body),
	})

	local data = HttpService:JSONDecode(response.Body)
	if not response.Success then
		error(data.detail or data.error or ("HTTP " .. tostring(response.StatusCode)))
	end
	return data
end

local data = chat("Hello Daedalus")
print(data.reply)
local conversationId = data.conversation_id

local follow = chat("Follow up question", conversationId)
print(follow.reply)

Uses Foundation URLSession with async/await and Codable. Works in a macOS/iOS app or a command-line executable. Do not embed a dk_ key in a shipped app binary; call the API from a server you control, or from a local tool that reads DAEDALUS_API_KEY. Optional fields are encoded only when present, so the first request does not send "conversation_id": null.

Swift
import Foundation

struct ChatRequest: Encodable {
    var message: String
    var conversation_id: Int?
    var model: String?

    func encode(to encoder: Encoder) throws {
        var container = encoder.container(keyedBy: CodingKeys.self)
        try container.encode(message, forKey: .message)
        try container.encodeIfPresent(conversation_id, forKey: .conversation_id)
        try container.encodeIfPresent(model, forKey: .model)
    }
}

struct ChatResponse: Decodable {
    let reply: String?
    let conversation_id: Int?
    let model: String?
    let error: String?
    let detail: String?
}

@main
struct DaedalusChat {
    static func main() async {
        do {
            let first = try await chat(message: "Hello Daedalus")
            print(first.reply ?? "")
            let conversationId = first.conversation_id

            let follow = try await chat(
                message: "Follow up question",
                conversationId: conversationId
            )
            print(follow.reply ?? "")
        } catch {
            fputs("\(error)\n", stderr)
            exit(1)
        }
    }

    static func chat(
        message: String,
        conversationId: Int? = nil,
        model: String? = nil
    ) async throws -> ChatResponse {
        guard let key = ProcessInfo.processInfo.environment["DAEDALUS_API_KEY"] else {
            throw URLError(.userAuthenticationRequired)
        }

        var request = URLRequest(url: URL(string: "https://astrovect.online/api/v1/chat")!)
        request.httpMethod = "POST"
        request.timeoutInterval = 120
        request.setValue("Bearer \(key)", forHTTPHeaderField: "Authorization")
        request.setValue("application/json", forHTTPHeaderField: "Content-Type")
        request.httpBody = try JSONEncoder().encode(
            ChatRequest(message: message, conversation_id: conversationId, model: model)
        )

        let (data, response) = try await URLSession.shared.data(for: request)
        let status = (response as? HTTPURLResponse)?.statusCode ?? 0
        let body = try JSONDecoder().decode(ChatResponse.self, from: data)
        if status >= 400 {
            throw NSError(
                domain: "Daedalus",
                code: status,
                userInfo: [
                    NSLocalizedDescriptionKey: body.detail ?? body.error ?? "HTTP \(status)"
                ]
            )
        }
        return body
    }
}

Compile and run (Swift 5.5 or later; -parse-as-library is required because of @main):

curl
swiftc -parse-as-library chat.swift -o chat
DAEDALUS_API_KEY=dk_your_key ./chat

OpenAPI UI

The /docs, /redoc, and /openapi.json pages are disabled in production and return 404. This guide is the public documentation for the personal-key API. Website-only routes such as POST /chat, POST /upload, conversations, billing, and admin are not part of this API.

OpenAPI UI

The /docs, /redoc, and /openapi.json pages are disabled in production and return 404. This guide is the public documentation for the personal-key API. Website-only routes such as POST /chat, POST /upload, conversations, billing, and admin are not part of this API.