API console
OpenAI-compatible: a base URL, a key and a model.
Base URL
https://api.darkbloom.dev/v1Quick start
- Key
- Your console key appears once your keys load.
- Model
- Any ID from
/v1/models.
# No installation needed
export DARKBLOOM_API_KEY="<YOUR_API_KEY>"
export DARKBLOOM_BASE_URL="https://api.darkbloom.dev/v1"API keys
Keys share your account balance. You can set a spending limit per key.
Loading…
Endpoint reference
Requires an
Authorization: Bearer <api_key>header.Request
{ "model": "<model-id-from-/v1/models>", "messages": [ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "Hello!"} ], "stream": true, "max_tokens": 1024 }Response
{ "id": "chatcmpl-...", "object": "chat.completion.chunk", "model": "<model-id-from-/v1/models>", "choices": [{ "index": 0, "delta": {"role": "assistant", "content": "Hello"}, "finish_reason": null }] }Supports streaming (SSE) and non-streaming responses. Requests use encrypted network hops; the coordinator processes plaintext in memory and re-encrypts it to the provider. Response headers include provider attestation metadata (x-provider-attested, x-provider-trust-level, x-provider-chip).
Requires an
Authorization: Bearer <api_key>header.Request
{ "model": "<model-id-from-/v1/models>", "input": "Explain how decentralized inference works.", "stream": false, "max_output_tokens": 1024 }Response
{ "id": "resp_...", "object": "response", "model": "<model-id-from-/v1/models>", "output": [{ "type": "message", "role": "assistant", "content": [{ "type": "output_text", "text": "Decentralized inference distributes..." }] }], "usage": { "input_tokens": 12, "output_tokens": 256 } }OpenAI Responses API format. Accepts 'input' (string or array) instead of 'messages'. Uses input_tokens/output_tokens for usage. With "stream": true the response arrives as server-sent events instead of the single object shown. Same routing, encryption, and billing as chat completions.
Requires an
Authorization: Bearer <api_key>header.Response
{ "data": [ { "id": "<model-id-from-/v1/models>", "object": "model", "name": "Example Model", "hugging_face_id": "<model-id-from-/v1/models>", "created": 1735689600, "description": "Illustrative values. Call this endpoint for each model's real limits and prices.", "input_modalities": ["text"], "output_modalities": ["text"], "quantization": "int8", "context_length": 262144, "max_output_length": 16384, "pricing": { "prompt": "0.00000005", "completion": "0.0000002", "image": "0", "request": "0", "input_cache_read": "0.000000025" }, "supported_sampling_parameters": ["temperature", "top_p", "top_k", "stop", "seed", "max_tokens"], "supported_features": ["tools", "reasoning"], "metadata": { "model_type": "chat", "provider_count": 2, "trust_level": "hardware", "display_name": "Example Model" } } ] }OpenAI-compatible model list. Top-level fields follow the OpenRouter provider schema (per-token USD pricing strings, modalities, supported features). pricing.input_cache_read is the per-token rate for prompt tokens a provider serves from its prefix cache (reported back as usage.prompt_tokens_details.cached_tokens). Darkbloom-native fields (trust_level, provider_count) live under metadata. A dedicated OpenRouter provider feed (pure schema, no metadata) is served at GET /v1/models/openrouter.
Public: no API key needed.
Response
{ "snapshot_at": "2026-11-05T09:00:00Z", "active_providers": 120, "code_attested_providers": 104, "total_requests": 1840000, "total_tokens": 2950000000, "last_24h_requests": 52000, "last_24h_prompt_tokens": 61000000, "last_24h_completion_tokens": 23000000, "last_24h_total_tokens": 84000000, "avg_tokens_per_request": 1615, "total_gpu_cores": 4800, "total_memory_gb": 15360, "network_capacity_tps": 9600, "verification_counts": { "connections": 120, "authorized": 118, "app_attest": 96, "legacy": 110, "overlap": 88 }, "models": [ {"id": "<model-id-from-/v1/models>", "providers": 42} ], "providers": [ { "id": "...", "chip": "Apple M4 Max", "machine_model": "Mac16,5", "memory_gb": 128, "gpu_cores": 40, "status": "serving", "trust_level": "hardware", "decode_tps": 84.2, "models": ["<model-id-from-/v1/models>"], "current_model": "<model-id-from-/v1/models>" } ], "time_series": [ {"timestamp": "2026-11-05T08:59:00Z", "requests": 38, "prompt_tokens": 44000, "completion_tokens": 16500, "total_tokens": 60500} ] }Trimmed: the live response is about 1.3 MB. It carries one row per online provider, the per-minute time_series, network_utilization, model_earnings, lifetime totals and privacy-floored geography buckets (provider_locations and others); location buckets with too few providers or requests are left out.
Public: no API key needed.
Response
{ "providers": [{ "provider_id": "...", "chip_name": "Apple M4 Max", "hardware_model": "Mac16,5", "memory_gb": 128, "gpu_cores": 40, "models": ["<model-id-from-/v1/models>"], "trust_level": "self_signed", "status": "serving", "verification": { "observed_at": 1793869200, "app_attest": {"state": "verified", "verified_at": 1793865600, "expires_at": 1793952000}, "legacy": {"state": "pending"} }, "app_attest_authorized": true, "authorization_expires_at": 1793952000, "secure_enclave": true, "sip_enabled": true, "secure_boot_enabled": true, "authenticated_root_enabled": true, "system_volume_hash": "...", "se_public_key": "...", "mdm_verified": false, "acme_verified": false, "mda_verified": false }] }Publicly accessible — no authentication required. status is online, serving or untrusted; trust_level is hardware, self_signed or none; each verification path's state is verified, pending, expired, revoked, unsupported or offline. Times are Unix seconds. authorization_expires_at and system_volume_hash appear only when known. mdm_verified, acme_verified and mda_verified are deprecated and always false. Hardware serials, UDIDs, and raw Apple certificate chains stay private to the provider and coordinator.
Public: no API key needed.
Response
{ "prices": [ {"model": "<model-id-from-/v1/models>", "input_price": 50000, "output_price": 200000, "cache_read_price": 25000, "input_usd": "$0.0500", "output_usd": "$0.2000", "cache_read_usd": "$0.0250"} ], "fallback_input_price": 50000, "fallback_output_price": 200000, "fallback_cache_read_price": 25000, "fallback_input_usd": "$0.0500", "fallback_output_usd": "$0.2000", "fallback_cache_read_usd": "$0.0250" }Prices are micro-USD per 1M tokens. cache_read_price is what prompt tokens served from a provider's prefix cache cost instead of input_price; models that set no explicit rate default to half the input price.
Requires an
Authorization: Bearer <api_key>header.Response
{ "balance_micro_usd": 5000000, "balance_usd": "5.000000", "withdrawable_micro_usd": 0, "withdrawable_usd": "0.000000" }Amounts come in micro-USD integers and as USD strings with six decimals. The withdrawable fields are the part of the balance that can be paid out: provider earnings and rewards, not purchased credit.
Requires an
Authorization: Bearer <api_key>header.Response
{ "usage": [ { "job_id": "...", "model": "<model-id-from-/v1/models>", "prompt_tokens": 150, "cached_tokens": 120, "completion_tokens": 500, "cost_micro_usd": 104, "timestamp": "2026-04-11T22:00:00Z" } ] }
Request examples
Chat completions
curl -X POST https://api.darkbloom.dev/v1/chat/completions \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"model": "<model-id-from-/v1/models>",
"messages": [{"role": "user", "content": "Explain quantum computing"}],
"stream": true,
"max_tokens": 1024
}'List models
from openai import OpenAI
client = OpenAI(base_url="https://api.darkbloom.dev/v1", api_key="<YOUR_API_KEY>")
models = client.models.list()
for model in models.data:
print(f"{model.id}")