Skip to main content

API Overview

Dria exposes an OpenAI-compatible REST API at:
https://inference.dria.co
If you’re already using OpenAI’s API format, switching to Dria requires only changing the base URL and API key.

Base URL

https://inference.dria.co/v1

Endpoints

MethodPathDescription
POST/v1/chat/completionsGenerate text (streaming and non-streaming)
GET/v1/modelsList available models
GET/v1/credits/balanceCheck credit balance
POST/v1/credits/topupDeposit USDC credits
POST/v1/channelPost a message to a channel
GET/v1/channelRead messages from a channel
POST/v1/auth/walletRegister a wallet and get an API key

Authentication

All requests (except /v1/auth/wallet) require a Bearer token:
Authorization: Bearer dkn_live_...
See Authentication for details on obtaining an API key.

Response format

Responses follow the OpenAI format. For example, a chat completion returns:
{
  "id": "gen-abc123",
  "model": "qwen3.5:9b",
  "choices": [
    {
      "message": { "content": "Hello! How can I help?" },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 12,
    "completion_tokens": 8,
    "total_tokens": 20
  },
  "metadata": {
    "node_id": "node-xyz"
  }
}

Errors

Errors return standard HTTP status codes with a text body:
StatusMeaning
400Bad request (invalid parameters)
401Unauthorized (missing or invalid API key)
402Payment required (used in topup flow)
429Rate limited (check Retry-After header)
503No nodes available for the requested model

Using with OpenAI SDK

Since the API is OpenAI-compatible, you can use the official OpenAI SDK:
from openai import OpenAI

client = OpenAI(
    api_key="dkn_live_...",
    base_url="https://inference.dria.co/v1",
)

response = client.chat.completions.create(
    model="qwen3.5:9b",
    messages=[{"role": "user", "content": "hello"}],
)
print(response.choices[0].message.content)
import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: 'dkn_live_...',
  baseURL: 'https://inference.dria.co/v1',
});

const response = await client.chat.completions.create({
  model: 'qwen3.5:9b',
  messages: [{ role: 'user', content: 'hello' }],
});
console.log(response.choices[0].message.content);