Skip to content

Quick Start

Welcome to Daya! This guide walks you through everything from signing up to making your first API request, step by step.

💡 Get Started in 4 Steps

Just four simple steps to start using Daya:

  1. Sign in to Daya: Visit the Daya login page and sign in using any of the following:

    • Email
    • GitHub account
    • Google account
  2. Choose a usage plan: Based on your use case, select Pay As You Go or Builder Plan.

  3. Get an API key: After signing in, create an API key from the corresponding management page.

  4. Make your first request: Pick the API protocol you're most familiar with, copy the code example below, replace your API key, and run it.


Choose a Usage Plan

Daya offers two usage plans to fit different scenarios:

Pay As You Go

Best for: Production environments, commercial products, high-concurrency applications

Pay As You Go uses a prepaid balance + usage-based billing model, purpose-built for production workloads:

  • No rate limits — supports high-concurrency calls
  • Per-token billing — transparent and predictable costs

Go to the Pay As You Go management page to top up your balance and create an API key.

Pay As You Go management page

📚 Detailed Guide

For complete instructions, see the Pay As You Go Guide.

Builder Plan (Subscription)

Best for: Personal development, learning and exploration, Vibe Coding, rapid prototyping

Builder Plan provides a fixed monthly fee with predictable AI model access:

  • Fixed monthly fee starting at $20/month
  • All-star model lineup — one subscription unlocks 100+ top models worldwide
  • Full-scenario coverage — Coding + image generation + video generation + chat, all in one place

Go to the Pricing page to view plan details and subscribe.

Subscription plan comparison

📚 Detailed Guide

For complete instructions, see the Subscription Plans Guide.

Plan Comparison

DimensionPay As You GoBuilder Plan (Subscription)
Best forProduction, commercial productsPersonal development, learning
BillingUsage-based, per-tokenFixed monthly fee
Rate LimitUnlimited10–15 RPM
ConcurrencyUnlimitedWeekly Limit applies
RestrictionsNoneNot allowed for production use

⚠️ Important

If your project is already live or heading toward commercialization, you must use the Pay As You Go plan. The subscription plan is strictly for personal development and learning — production use is prohibited.


How to Obtain Model Slugs

Each model on the Daya platform has a unique slug. You can find model slugs on the Models page: model-slug Or on a model's detail page: model-slug


Supported API Protocols

Daya supports four major API protocols, letting you use your preferred SDK to call any model on the platform:

ProtocolBase URLCompatible SDKDescription
OpenAI Chat Completionshttps://api.dayaai.com/v1OpenAI SDKThe most widely used Chat API
OpenAI Responseshttps://api.dayaai.com/v1OpenAI SDKOpenAI's next-gen Responses API
Anthropic Messageshttps://api.dayaai.com/v1Anthropic SDKAnthropic-compatible endpoint on the same /v1 base
Google Geminihttps://api.dayaai.comGoogle GenAI SDKGemini-compatible endpoint, with REST paths under /v1beta

💡 Cross-Protocol Calling

One of Daya's core strengths is protocol agnosticism — you can call any model through any supported protocol. For example, use the OpenAI SDK to call Claude models, or the Anthropic SDK to call Gemini models.


Protocol 1: OpenAI Chat Completions

Compatibility

Daya's API endpoint is fully compatible with the OpenAI Chat Completions API. Just change base_url and api_key to switch seamlessly.

python
from openai import OpenAI

# 1. Initialize the OpenAI client
client = OpenAI(
    # 2. Point the base URL to the Daya endpoint
    base_url="https://api.dayaai.com/v1", 
    # 3. Replace with the API key from your Daya console
    api_key="<your DAYA_API_KEY>", 
)

# 4. Create a Chat Completion request
completion = client.chat.completions.create(
    # 5. Specify the model in "provider/model-name" format
    model="google/gemini-3.1-pro-preview", 
    messages=[
        {
            "role": "user",
            "content": "What is the meaning of life?"
        }
    ]
)

print(completion.choices[0].message.content)
ts
import OpenAI from "openai";

// 1. Initialize the OpenAI client
const openai = new OpenAI({
  // 2. Point the base URL to the Daya endpoint
  baseURL: "https://api.dayaai.com/v1", 
  // 3. Replace with the API key from your Daya console
  apiKey: "<your DAYA_API_KEY>", 
});

async function main() {
  // 4. Create a Chat Completion request
  const completion = await openai.chat.completions.create({
    // 5. Specify the model in "provider/model-name" format
    model: "google/gemini-3.1-pro-preview", 
    messages: [
      {
        role: "user",
        content: "What is the meaning of life?",
      },
    ],
  });

  console.log(completion.choices[0].message.content);
}

main();
bash
curl https://api.dayaai.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $DAYA_API_KEY" \
  -d '{
    "model": "google/gemini-3.1-pro-preview",
    "messages": [
      {
        "role": "user",
        "content": "What is the meaning of life?"
      }
    ]
  }'

Protocol 2: OpenAI Responses

Compatibility

Daya is also compatible with OpenAI's next-gen Responses API. The base URL is the same as Chat Completions, with a more streamlined calling convention.

python
from openai import OpenAI

client = OpenAI(
    base_url="https://api.dayaai.com/v1", 
    api_key="<your DAYA_API_KEY>", 
)

# Create a request using the Responses API
response = client.responses.create(
    model="google/gemini-3.1-pro-preview", 
    input="What is the meaning of life?"
)

print(response.output_text)
ts
import OpenAI from "openai";

const openai = new OpenAI({
  baseURL: "https://api.dayaai.com/v1", 
  apiKey: "<your DAYA_API_KEY>", 
});

async function main() {
  const response = await openai.responses.create({
    model: "google/gemini-3.1-pro-preview", 
    input: "What is the meaning of life?", 
  });

  console.log(response.output_text);
}

main();
bash
curl https://api.dayaai.com/v1/responses \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $DAYA_API_KEY" \
  -d '{
    "model": "google/gemini-3.1-pro-preview",
    "input": "What is the meaning of life?"
  }'

Protocol 3: Anthropic Messages

Compatibility

Daya fully supports the Anthropic Messages protocol and integrates seamlessly with tools like Claude Code and Cursor.

Anthropic-compatible requests use the same Daya base URL, https://api.dayaai.com/v1, but the endpoint path is /messages instead of /chat/completions or /responses.

Anthropic Protocol Model Support

Models compatible with the Anthropic protocol are being adapted in batches. You can view currently supported models by filtering for Anthropic API Compatible on the official model list: anthropic-support You can also check on a model's detail page: anthropic-support

python
from anthropic import Anthropic

# 1. Initialize the Anthropic client
client = Anthropic(
    # 2. Point the base URL to the Daya endpoint
    base_url="https://api.dayaai.com/v1", 
    # 3. Replace with the API key from your Daya console
    api_key="<your DAYA_API_KEY>", 
)

# 4. Create a Messages request
message = client.messages.create(
    model="google/gemini-3.1-pro-preview", 
    max_tokens=1024,
    messages=[
        {
            "role": "user",
            "content": "What is the meaning of life?"
        }
    ]
)

print(message.content[0].text)
ts
import Anthropic from "@anthropic-ai/sdk";

// 1. Initialize the Anthropic client
const client = new Anthropic({
  // 2. Point the base URL to the Daya endpoint
  baseURL: "https://api.dayaai.com/v1", 
  // 3. Replace with the API key from your Daya console
  apiKey: "<your DAYA_API_KEY>", 
});

async function main() {
  // 4. Create a Messages request
  const message = await client.messages.create({
    model: "google/gemini-3.1-pro-preview", 
    max_tokens: 1024,
    messages: [
      {
        role: "user",
        content: "What is the meaning of life?",
      },
    ],
  });

  console.log(message.content[0].text);
}

main();
bash
curl https://api.dayaai.com/v1/messages \
  -H "content-type: application/json" \
  -H "x-api-key: $DAYA_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -d '{
    "model": "google/gemini-3.1-pro-preview",
    "max_tokens": 1024,
    "messages": [
      {
        "role": "user",
        "content": "What is the meaning of life?"
      }
    ]
  }'

Protocol 4: Google Gemini

Compatibility

Daya supports the Google Gemini-compatible /v1beta/models API, allowing you to call Gemini-family models with the Google GenAI SDK.

Use https://api.dayaai.com as the SDK base URL, and set api_version / apiVersion to v1beta.

python
from google import genai
from google.genai import types

# 1. Initialize the Google GenAI client
client = genai.Client(
    # 2. Replace with the API key from your Daya console
    api_key="<your DAYA_API_KEY>", 
    vertexai=True, 
    # 3. Point the base URL to the Daya endpoint
    http_options=types.HttpOptions(
        api_version='v1beta',
        base_url='https://api.dayaai.com'
    )
)

# 4. Create a generateContent request
response = client.models.generate_content(
    model="gemini-3.1-pro-preview", 
    contents="What is the meaning of life?"
)

print(response.text)
ts
import { GoogleGenAI } from "@google/genai";

// 1. Initialize the Google GenAI client
const ai = new GoogleGenAI({
  // 2. Replace with the API key from your Daya console
  apiKey: "<your DAYA_API_KEY>", 
  vertexai: true, 
  // 3. Point the base URL to the Daya endpoint
  httpOptions: {
    apiVersion: "v1beta",
    baseUrl: "https://api.dayaai.com", 
  },
});

async function main() {
  // 4. Create a generateContent request
  const response = await ai.models.generateContent({
    model: "gemini-3.1-pro-preview", 
    contents: "What is the meaning of life?",
  });

  console.log(response.text);
}

main();

Platform API

Daya provides a set of Platform Management APIs that let you programmatically query account usage, balance, subscription status, and more — making it easy to integrate with your monitoring and management systems.

⚠️ Management API Key

Platform APIs require a Management API Key for authentication (some endpoints also accept a regular API key). Go to Daya Console > Management to create a Management API Key.

Query Generation Details

Retrieve detailed information about a specific API call, including token usage, latency, and billing breakdown.

GET https://api.dayaai.com/api/v1/management/generation?id=<generation_id>

Each API call returns a generation_id. Use that ID to query the full details of the call:

bash
curl https://api.dayaai.com/api/v1/management/generation?id=gen_01abc123def456 \
  -H "Authorization: Bearer $DAYA_API_KEY"

Example response (partial):

json
{
  "api": "chat.completions",
  "generationId": "gen_01abc123def456",
  "model": "openai/gpt-4o",
  "generationTime": 3200,
  "latency": 500,
  "nativeTokens": {
    "completion_tokens": 128,
    "prompt_tokens": 32,
    "total_tokens": 160
  },
  "usage": 0.0052
}

💡 Billing Data Delay

Billing information (such as usage and ratingResponses) becomes available 3–5 minutes after the request completes. Token usage metrics are returned synchronously with the request.

📚 Full Documentation

For detailed parameter descriptions, see the Get Generation API docs.


Query PAYG Balance

Retrieve the current Pay As You Go balance for your account.

GET https://api.dayaai.com/api/v1/management/payg/balance
bash
curl https://api.dayaai.com/api/v1/management/payg/balance \
  -H "Authorization: Bearer $DAYA_MANAGEMENT_API_KEY"

Example response:

json
{
  "success": true,
  "data": {
    "currency": "usd",
    "total_credits": 482.74,
    "top_up_credits": 35.00,
    "bonus_credits": 447.74
  }
}

📚 Full Documentation

For detailed parameter descriptions, see the Get PAYG Balance API docs.


Query Subscription Details

Retrieve your account's subscription information, including plan tier, Flow rate, and quota usage.

GET https://api.dayaai.com/api/v1/management/subscription/detail
bash
curl https://api.dayaai.com/api/v1/management/subscription/detail \
  -H "Authorization: Bearer $DAYA_MANAGEMENT_API_KEY"

Example response (partial):

json
{
  "success": true,
  "data": {
    "plan": {
      "tier": "ultra",
      "amount_usd": 200,
      "interval": "month"
    },
    "account_status": "healthy",
    "quota_5_hour": {
      "max_flows": 800,
      "used_flows": 57.2,
      "remaining_flows": 742.8,
      "usage_percentage": 0.0715
    },
    "quota_7_day": {
      "max_flows": 6182,
      "used_flows": 416.11,
      "remaining_flows": 5765.89
    }
  }
}

📚 Full Documentation

For detailed parameter descriptions, see the Get Subscription Detail API docs.


Query Flow Rate

Retrieve the current Flow rate information for your account.

GET https://api.dayaai.com/api/v1/management/flow_rate
bash
curl https://api.dayaai.com/api/v1/management/flow_rate \
  -H "Authorization: Bearer $DAYA_MANAGEMENT_API_KEY"

Example response:

json
{
  "success": true,
  "data": {
    "currency": "usd",
    "base_usd_per_flow": 0.03283,
    "effective_usd_per_flow": 0.03283
  }
}

📚 Full Documentation

For detailed parameter descriptions, see the Get Flow Rate API docs.


Advanced Usage

For more details on advanced usage, refer to the Advanced Usage section.

Contact Us

If you encounter any issues or have suggestions and feedback, feel free to reach out:

For more contact options and details, visit our Contact Us page.