DARKMINDDARK INTELLIGENCE
[ DEVELOPERS / API V1 ]

DARKMIND API_

Connect DARKMIND models to your product. Chat, code, images, video and audio with a personal key, shared balance and verifiable charges.

01 / GETTING STARTED

  1. Create an account or sign in. Confirm you are 18+ and accept the service rules in your workspace.
  2. Create an API key in your account and save its secret: it is displayed only once.
  3. Store it as DARKMIND_API_KEY on your app’s server. Keep the secret out of browser code.

Base URL: https://darkmind.chat/api/v1
Authorization: Bearer YOUR_API_KEY

Keys work with API v1 and use their owner’s balance. They cannot access the admin panel, issue more keys or sign in to the website. Up to 10 active keys per account. Email password recovery revokes all keys. Revoke a lost or exposed key immediately from your account.

02 / CHAT COMPLETIONS

Request and response shapes follow Chat Completions. Get available IDs from GET /models. Rates and modes can change; select a model from the current API response.

Each new paid request requires a unique Idempotency-Key (8–120 letters, digits, _ . : -). Use that same ID when checking its status. Repeating an accepted request returns 409 without a second generation. OpenAI format compatibility does not imply support for every OpenAI API.

cURL

curl https://darkmind.chat/api/v1/chat/completions \
  -H "Authorization: Bearer $DARKMIND_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: my-project-request-0001" \
  -d '{
    "model": "deepseek-v4-1-flash-1017-uncensored",
    "messages": [{"role": "user", "content": "Hello!"}],
    "max_tokens": 512,
    "stream": false
  }'

JavaScript / Node.js

// Run on your server, with the key in an environment variable.
const requestId = crypto.randomUUID();
const response = await fetch("https://darkmind.chat/api/v1/chat/completions", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.DARKMIND_API_KEY,
    "Content-Type": "application/json",
    "Idempotency-Key": requestId
  },
  body: JSON.stringify({
    model: "deepseek-v4-1-flash-1017-uncensored",
    messages: [{ role: "user", content: "Hello!" }],
    max_tokens: 512
  })
});
const result = await response.json();
if (!response.ok) throw new Error(result.error?.code || "REQUEST_FAILED");
console.log(result.choices[0].message.content);
console.log(result.darkmind.charge_usd);

Python

import json, os, urllib.request, uuid

request = urllib.request.Request(
    "https://darkmind.chat/api/v1/chat/completions",
    data=json.dumps({
        "model": "deepseek-v4-1-flash-1017-uncensored",
        "messages": [{"role": "user", "content": "Hello!"}],
        "max_tokens": 512
    }).encode(),
    headers={
        "Authorization": "Bearer " + os.environ["DARKMIND_API_KEY"],
        "Content-Type": "application/json",
        "Idempotency-Key": str(uuid.uuid4())
    }, method="POST"
)
with urllib.request.urlopen(request, timeout=960) as response:
    result = json.load(response)
    print(result["choices"][0]["message"]["content"])
    print(result["darkmind"]["charge_usd"])

Set stream:true for a text/event-stream response. The final usage/darkmind chunk contains the committed charge; data: [DONE] ends the stream. Intermediate tokens are not a final bill.

Chat images use image_url with data:image/...;base64,... in a user message. Arbitrary remote image URLs are not fetched. JSON requests are limited to 8 MiB; PNG, JPEG, WebP and GIF files must be valid.

03 / IMAGES, VIDEO & AUDIO

Choose a model from GET /catalog. Its constraints and metadata describe supported settings. For editing, transcription and other input-based tasks, upload the file with POST /assets and pass its ID in assetIds.

POST /quotes

{
  "modelId": "YOUR_ACTIVE_IMAGE_MODEL_ID",
  "prompt": "A moonlit futuristic city",
  "options": {
    "aspect_ratio": "1:1"
  },
  "assetIds": []
}

The aspect_ratio example applies only to models that support it. Read quote.id, maximum_usd and expiresAt. A quote also requires an Idempotency-Key.

POST /generations

{
  "quoteId": "YOUR_QUOTE_ID"
}

Send a new Idempotency-Key, different from the quote ID. The server commits the task and reservation, then returns HTTP 202 with pending status. Save generation.id and poll GET /generations/{id}. A retry with the same key and quoteId returns the same task; do not automatically create a new key. Closing your client does not cancel a paid generation that has already started.

Each source file is limited to 20 MiB; up to 8 files and 30 MiB total, subject to the model’s constraints. New media is retained for up to 14 minutes from file creation. Download results promptly: expiresAt and signed-link expiry can differ.

Handle download redirects explicitly: request /assets/{id} with your key, then fetch its darkmind.live Location without Authorization or cookies. Never forward your API key to media storage.

04 / API V1 ENDPOINTS

GET/models

Active text models: IDs, reasoning modes, capabilities and per-million-token rates.

POST/chat/completions

Chat and code using the OpenAI Chat Completions format. JSON or SSE (stream:true). Tools and images require a capable model.

GET/requests/{requestId}

Chat status and final charge, using its Idempotency-Key as requestId. Returns this account’s requests only.

GET/catalog

The full active catalog, including image, video, audio, editing, modes and constraints.

POST/assets

Upload an image, audio or video: multipart/form-data with a file field. Returns {asset:{id,url,expiresAt,...}}.

POST/quotes

Media quote: {modelId,prompt,options,assetIds}. Returns {quote:{id,estimated_usd,maximum_usd,expiresAt,...}}. Does not start generation.

POST/generations

Submit an accepted quote: {quoteId}. HTTP 202 and pending mean an accepted task; poll GET /generations/{id}. Use a separate Idempotency-Key.

GET/generations/{id}

Status and result of your generation. Poll pending; download completed files; contact support for uncertain outcomes instead of submitting a paid duplicate.

GET/generations?limit=20&offset=0

A page of your generations: {generations,limit,offset,hasMore}. Up to 50 per request.

GET/assets/{id}

A private file owned by this account. May return 302 to a temporary signed darkmind.live URL.

05 / BILLING & ERRORS

The website, desktop app, Telegram and API share one balance and accounting. DARKMIND service rates are in USD. For chat, darkmind.charge_usd and usage.cost report the final charge; media uses generation.charge_usd. Funds may be reserved while a request is pending.

Errors use {error:{code,message}}. 401: invalid/revoked key; 402: insufficient funds; 403: access, policy or account restriction; 409: conflict/already accepted request; 422: unsupported parameters; 429: request limit; 503: temporarily unavailable.

After a connection failure, check /requests/{requestId} for chat or /generations/{id} for media. Do not automatically submit another paid request while the first outcome is unknown. Requests already in flight may finish after their key is revoked.

Ticket support — include the error code and request ID, never the key itself.