DataEyesAI
Official SiteConsoleDocs Home
Getting StartedDeveloper ToolsAI Models API
Official SiteConsoleDocs Home
Getting StartedDeveloper ToolsAI Models API
  1. System interface
  • Getting Started
    • Overview
    • Console (Getting Started)
    • API Key
    • Base URL
  • Developer Tool Integration
    • OpenClaw
    • Claude Code
    • Codex
    • Gemini CLI
    • Grok CLI
    • Other Tools
  • AI Models API
    • OpenAI format (supports major original models)
      • Chat (Response)
        • Create Network Search
        • Create Model Response GPT-5 Enable Thinking
        • Create Function Call
        • Create Model Response
        • Create Model Response (Streaming Return)
        • Create Model Response (Control Thinking Length)
      • ChatGPT Interface
        • Audio
          • Audio to text gpt-4o-transcribe
          • GPT-4o-audio
          • Audio to text whisper-1
          • Audio to text gpt-4o-transcribe
          • Create voice gpt-4o-mini-tts
        • Chat
          • Create chat-based image recognition (non-streaming)
          • Create chat-based image recognition (streaming)
          • Create chat-based image recognition (streaming) best64
          • Official N test
          • Create structured output
          • Control the effort level of the inference model
          • Create chat function call
          • deepseek-ocr recognition
          • Create chat completion (non-stream)
        • Completions
          • ChatGPT automatic completion
          • Create completion
      • Image
        • Edit image
        • Create chat completion (streaming)
        • Create chat completion (qwen-mt-turbo)
        • Create chat completion with deepseek v3.1 level of reasoning (streaming)
      • Audio
        • Speech recognition
        • Speech synthesis
        • Official Function Calling invocation
        • Create chat-generated images (non-streaming)
      • Embedding
        • Text embeddings
    • Anthropic format
      • Chat
      • Chat(prompt cache)
      • Streaming response
      • Chat (deep reasoning)
      • Tool invocation (function call)
      • Analyze image
    • Google Gemini interface
      • Native format
        • Text-to-image + control over aspect ratio + clarity
        • Generate image
        • Text generation
        • Text generation - stream
        • Text generation + reasoning - stream
        • Image generation
        • Formatted output
        • Function call
        • Document understanding
        • URL context [native format]
        • Code execution
        • Video understanding
        • URL context
        • Video understanding - url [native format]
        • Imagen 4
        • Audio understanding
        • Embeddings
        • Chat
        • Edit image
      • Image-to-image Base64 request method
        • Multi-image fusion slice generation with gemini-3-pro-image-preview, controlling aspect ratio and clarity
        • Image editing
        • Single image gemini-3-pro-image-preview, controlling aspect ratio and clarity.
        • Image generation( gemini-2.5-flash-image)
        • Image generation gemini-2.5-flash-image, controlling aspect ratio.
        • Image understanding
      • Image-to-image URL request returns URL request format OpenAI
        • Single image generation with gemini-3-pro-image-preview, controlling aspect ratio and clarity.
        • Multi-image fusion slice generation with gemini-3-pro-image-preview, controlling aspect ratio and clarity.
        • Image understanding
    • NanoBanana
      • OpenAI request
        • Edit image
        • OpenAI image format
      • Gemini request
        • Generate image
        • Edit image
    • Midjourney format
      • Midjourney API Reference
      • Task query interface
      • Upload image
      • Get seed (Seed)
      • Submit Imagine task
      • Query tasks based on ID list
      • FaceSwap
      • Execute Action operation
      • /mj/submit/blend
      • Submit Describe task
      • Submit Modal
      • Refresh link
      • Edit image
      • Query task status by task ID
      • Get the seed of the task image
    • Doubao - Painting
      • doubao-seededit-3-0-i2i-250628
      • doubao-seedream-4-0-250828 - text-to-image
      • doubao-seedream-4-0-250828 - image-to-image
      • doubao-seedream-4-0-250828 - multi-image generation
    • Rerank Reordering Model
      • Rerank
    • Video Model
      • Grok Video Generation
        • 00-Overview
        • 01-Text-to-Video
        • 02-Image-to-Video
        • 03-Reference-to-Video
        • 04-Video-Editing
        • 05-Video-Extension
      • Seedance Video Generation
        • 00-Overview
        • 01-Create-Video-Generation-Task
        • 02-Query-Video-Generation-Task
        • 03-Query-Video-Generation-Task-List
        • 04-Cancel-or-Delete-Task
        • Seedance Private Asset Library API Documentation
      • MiniMax-H3 Video Generation
        • 00-Overview
        • 01-Create-Video-Generation
        • 02-Create-Video-Regeneration
        • 03-Create-H3-Context-IR
        • 04-Query-Task
        • 05-List-Tasks
        • 06-Cancel-or-Delete-Task
      • Hailuo Video Generation
        • 00-Overview
        • 01-Text-to-Video-T2V
        • 02-Image-to-Video-I2V
        • 03-First-Last-Frame-FL2V
        • 04-Subject-Reference-S2V
        • 05-Query-Task-Status
        • 06-Video-Download
        • 99-Appendix-Camera-Movement-and-Webhooks
      • Jimeng Video Generation
        • 00-Overview
        • 01-3.0-Pro-Video-Generation
        • 02-720P-Text-to-Video
        • 03-720P-Image-to-Video-First-Frame
        • 04-720P-Image-to-Video-Start-End-Frame
        • 05-720P-Image-to-Video-Camera
        • 06-1080P-Text-to-Video
        • 07-1080P-Image-to-Video-First-Frame
        • 08-1080P-Image-to-Video-Start-End-Frame
        • 09-Error-Codes
      • Kling AI Video Generation
        • 00-Overview
        • 01-Text-to-Video
        • 02-Image-to-Video
        • 03-Omni-Video
        • 04-Multi-Image-to-Video
        • 05-Motion-Control
        • 06-Multi-Elements
        • 07-Video-Extension
        • 08-Lip-Sync
        • 09-Avatar
        • 10-Text-to-Audio
        • 11-Video-to-Audio
        • 12-TTS
        • 13-Custom-Voices
        • 14-Image-Recognition
        • 15-Element-Management
        • 16-Video-Effects
      • Vidu Video Generation
        • 00-Overview
        • 01-Text-to-Video
        • 02-Image-to-Video
        • 03-Reference-to-Video
        • 04-Start-End-Frame
        • 05-Multi-Frame
        • 06-Scene-Template
        • 07-Template-Story
        • 08-Query-Tasks
      • HappyHorse
        • HappyHorse Text-to-Video
        • HappyHorse Image-to-Video (First Frame)
        • HappyHorse Reference-to-Video
        • HappyHorse Video Editing
      • Wan Video Generation
        • 00-Overview.md
        • 01-Text-to-Video
        • 02-Image-to-Video
        • 03-Reference-to-Video
        • 04-Video-Editing
        • 05-First-Last-Frame-to-Video
        • 06-Motion-Transfer-and-Character-Swap
        • 07-Digital-Human-Video
        • 08-VACE-Video-Editing
        • 09-Query-Task
    • Audio API
      • Audio API
      • Gemini TTS API
      • Google DeepMind Lyria API
      • Elevenlabs Speech to Text API Reference
      • Text-to-Music Suno
        • Task Submission
          • Generate Song (Inspiration Mode)
          • Generate Song (Custom Mode)
          • Generate Song (Continuation Mode)
          • Generate Song (Singer Style)
          • Generate Song (Secondary Creation from Uploaded Song)
          • Generate Song (Song Stitching)
          • Generate Lyrics
          • Song Stitching
        • Query Interface
          • Batch Retrieve Tasks
          • Query Single Task
  • Search / Reader Product
    • Web Reader API​​
      • Web Reader API
      • Web Reader API(HK)
    • Web Search API​​
      • Modal Card API
        • Weather
          • All City ID
          • Weather Query API
      • Web Search API
      • Video Search api
      • Trending Search API
    • Document OCR Parsing API
      • fiel upload
      • URL Parsing
  • Advanced & System API
    • Data Updates
    • System interface
      • API Key & Quota Query API
      • API Key Management API
    • API Reference​​
      • Error Codes
      • HTTP Notes
    • List models
      • Models
  1. System interface

API Key & Quota Query API

DataEyes AI — API Key & Quota Query API Reference#

Document Version: v2.0
Last Updated: 2026-06-01
Document Status: Production Verified
Service Region: International

Overview#

DataEyesAI Cloud provides a unified AI API gateway service, aggregating 100+ world-leading large models (OpenAI GPT, Anthropic Claude, Google Gemini, DeepSeek, Doubao, etc.) with OpenAI-compatible protocol access. This document provides detailed specifications for all API endpoints related to key status queries, quota management, usage statistics, and account administration.

Service Addresses#

PurposeAddress
AI Model Calls & OpenAI-Compatible Endpointshttps://platform.dataeyes.ai
Platform Management Endpointshttps://www.dataeyes.ai/apex
Important: OpenAI-compatible endpoints prefixed with /v1/ use the platform address; management endpoints prefixed with /api/ use the management proxy address. Do not mix these.

Authentication Methods#

Method 1: API Key Authentication#

For model calls and self-service quota queries. Pass the API Key via standard HTTP header:
Authorization: Bearer sk-xxxxxxxxxxxxxxxx
API Keys can be created and managed in the platform console under "Token Management".

Method 2: System Access Token Authentication#

For administrative operations (user information queries, token management, etc.). Requires both a system access token and the target user's numeric ID:
Authorization: Bearer <system_access_token>
apex-api-user: <user_numeric_id>
The system access token can be found in the console under "Personal Settings > Account Management > Security Settings". The user numeric ID must be obtained from a backend administrator.

Section I: OpenAI-Compatible Endpoints#

Fully compatible with OpenAI billing query specifications, supporting seamless integration with any OpenAI SDK or compatible client.
Base Address: https://platform.dataeyes.ai

1.1 Query Account Quota#

Retrieve the quota limits for the account associated with the current API Key.
Endpoint
GET /v1/dashboard/billing/subscription
Request Headers
NameRequiredDescription
AuthorizationYesBearer <API-Key>
Request Example
Response Example
{
  "object": "billing_subscription",
  "has_payment_method": true,
  "soft_limit_usd": 100000000,
  "hard_limit_usd": 100000000,
  "system_hard_limit_usd": 100000000,
  "access_until": 0
}
Response Fields
FieldTypeDescription
objectStringFixed value "billing_subscription"
has_payment_methodBooleanWhether a payment method is bound; always true
soft_limit_usdNumberSoft quota limit (USD) — triggers a warning notification when reached
hard_limit_usdNumberHard quota limit (USD) — service is suspended when reached
system_hard_limit_usdNumberSystem-level hard limit, identical to hard_limit_usd
access_untilIntegerSubscription expiration time (Unix timestamp); 0 means never expires
Unlimited Quota: When an API Key is configured with unlimited quota, all three limit fields return 100000000 (100 million USD), indicating no quota restrictions.

1.2 Query Cumulative Usage#

Retrieve the cumulative spending amount for the current API Key.
Endpoint
GET /v1/dashboard/billing/usage
Request Headers
NameRequiredDescription
AuthorizationYesBearer <API-Key>
Request Example
The start_date and end_date query parameters are OpenAI-compatible reserved fields. The current version returns total cumulative usage and does not filter by date range.
Response Example
{
  "object": "list",
  "total_usage": 601.41
}
Response Fields
FieldTypeDescription
objectStringFixed value "list"
total_usageNumberCumulative usage in cents (USD × 100). For example, 601.41 represents $6.01 spent

1.3 Query Available Model List#

Retrieve all models accessible by the current API Key.
Endpoint
GET /v1/models
Request Headers
NameRequiredDescription
AuthorizationYesBearer <API-Key>
Request Example
Response Example
{
  "data": [
    {
      "id": "gpt-4o",
      "object": "model",
      "created": 1626777600,
      "owned_by": "openai",
      "supported_endpoint_types": ["openai"]
    },
    {
      "id": "claude-opus-4-6",
      "object": "model",
      "created": 1626777600,
      "owned_by": "vertex-ai",
      "supported_endpoint_types": ["openai", "anthropic"]
    },
    {
      "id": "gemini-2.5-pro-thinking",
      "object": "model",
      "created": 1626777600,
      "owned_by": "custom",
      "supported_endpoint_types": ["openai", "gemini"]
    }
  ],
  "object": "list",
  "success": true
}
Response Fields
FieldTypeDescription
dataArrayModel list
data[].idStringModel identifier — use this value when making API calls
data[].objectStringFixed value "model"
data[].createdIntegerModel creation time (Unix timestamp)
data[].owned_byStringModel provider (e.g., openai, vertex-ai, xai, custom)
data[].supported_endpoint_typesArraySupported calling formats: openai, anthropic, gemini, image-generation, embeddings, rerank, etc.
objectStringFixed value "list"
successBooleanWhether the request succeeded

Section II: Platform-Specific Endpoints#

DataEyesAI platform-specific high-precision query endpoints that provide exact quota, usage, and permission details for individual API Keys. These endpoints are not restricted by group permissions — any valid API Key can call them.
Base Address: https://www.dataeyes.ai/apex

2.1 API Key Real-Time Status Query#

Precisely retrieve the current API Key's quota allocation, consumption, remaining balance, and model permission information.
Endpoint
GET /api/usage/token/
Request Headers
NameRequiredDescription
AuthorizationYesBearer <API-Key>
Request Example
Response Example (Limited Quota)
{
  "code": true,
  "message": "ok",
  "data": {
    "object": "token_usage",
    "name": "my-production-key",
    "total_granted": 5000000,
    "total_used": 20,
    "total_available": 4999980,
    "unlimited_quota": false,
    "model_limits": {},
    "model_limits_enabled": false,
    "expires_at": 0
  }
}
Response Example (Unlimited Quota)
{
  "code": true,
  "message": "ok",
  "data": {
    "object": "token_usage",
    "name": "default-key",
    "total_granted": 500000,
    "total_used": 3007043,
    "total_available": -2507043,
    "unlimited_quota": true,
    "model_limits": {},
    "model_limits_enabled": false,
    "expires_at": 0
  }
}
Response Fields
FieldTypeDescription
codeBooleanWhether the request succeeded; true indicates success
messageStringStatus description; "ok" on success
data.objectStringFixed value "token_usage"
data.nameStringAPI Key display name
data.total_grantedIntegerTotal allocated quota (internal units). Conversion: ÷ 500,000 = USD
data.total_usedIntegerCumulative consumed quota (internal units)
data.total_availableIntegerRemaining available quota (total_granted − total_used)
data.unlimited_quotaBooleanWhether this is an unlimited quota key. When true, quota limits do not apply
data.model_limitsObjectModel access restriction rules. Empty object {} means no restrictions
data.model_limits_enabledBooleanWhether model-level access control is enabled
data.expires_atIntegerKey expiration time (Unix timestamp); 0 means never expires
Quota Conversion Formula
USD Amount = Internal Quota Value ÷ 500,000
Internal Quota ValueEquivalent USDCalculation
5,000,000$10.005000000 ÷ 500000 = 10
3,007,043$6.013007043 ÷ 500000 ≈ 6.01
500,000$1.00500000 ÷ 500000 = 1
Unlimited Quota Note: When unlimited_quota = true, total_available may be negative, reflecting only that cumulative consumption exceeds the initial allocation — this does not affect service availability.

Section III: Console Management Endpoints#

The following endpoints serve platform administration scenarios, supporting programmatic management of user accounts, API Key lifecycle, and subscription information.
Base Address: https://www.dataeyes.ai/apex
Authentication: System Access Token + User Numeric ID (see "Method 2" above)

3.1 Get User Information#

Retrieve account details for a specified user.
Endpoint
GET /api/user/self
Request Headers
NameRequiredDescription
AuthorizationYesBearer <system_access_token>
apex-api-userYesTarget user's numeric ID
Request Example
Response Example
{
  "success": true,
  "message": "",
  "data": {
    "id": 669,
    "username": "example_user",
    "display_name": "example_user",
    "email": "user@example.com",
    "role": 1,
    "status": 1,
    "group": "pro",
    "quota": 4084864,
    "used_quota": 269527941,
    "request_count": 9412,
    "aff_code": "xxxx",
    "aff_count": 0,
    "aff_quota": 0,
    "aff_history_quota": 0,
    "inviter_id": 0
  }
}
Response Fields (data object)
FieldTypeDescription
idIntegerUser numeric ID
usernameStringLogin username
display_nameStringDisplay name
emailStringRegistered email address
roleIntegerUser role. 1 = Regular user, 10 = Administrator, 100 = Super administrator
statusIntegerAccount status. 1 = Active, 2 = Disabled
groupStringUser's billing group
quotaIntegerAccount-level remaining quota (internal units, ÷500000 = USD)
used_quotaIntegerAccount-level total consumed quota
request_countIntegerCumulative API request count
aff_codeStringReferral code
aff_countIntegerNumber of referred users
aff_quotaIntegerPending referral reward quota
aff_history_quotaIntegerHistorical cumulative referral rewards
inviter_idIntegerInviter's user ID; 0 means no inviter

3.2 Get API Key List#

Retrieve all API Keys for a specified user, with pagination support.
Endpoint
GET /api/token/
Request Headers
NameRequiredDescription
AuthorizationYesBearer <system_access_token>
apex-api-userYesTarget user's numeric ID
Query Parameters
ParameterTypeDefaultDescription
pInteger1Page number
sizeInteger10Items per page
Request Example
Response Example
{
  "success": true,
  "message": "",
  "data": {
    "page": 1,
    "page_size": 10,
    "total": 56,
    "items": [
      {
        "id": 11848,
        "user_id": 669,
        "key": "0jCu7MEFsd6jzr...",
        "status": 1,
        "name": "openai-vip-pro",
        "created_time": 1778838568,
        "accessed_time": 1779028792,
        "expired_time": -1,
        "remain_quota": -1279,
        "unlimited_quota": true,
        "model_limits_enabled": false,
        "model_limits": "",
        "allow_ips": "",
        "used_quota": 1279,
        "group": "gpt-vip-pro",
        "cross_group_retry": false
      }
    ]
  }
}
Response Fields (data.items[])
FieldTypeDescription
idIntegerAPI Key numeric ID
user_idIntegerOwner's user ID
keyStringKey value (without sk- prefix)
statusIntegerKey status. 1 = Active, 2 = Disabled, 3 = Expired
nameStringKey display name
created_timeIntegerCreation time (Unix timestamp)
accessed_timeIntegerLast access time (Unix timestamp)
expired_timeIntegerExpiration time (Unix timestamp); -1 = Never expires
remain_quotaIntegerRemaining quota (internal units)
unlimited_quotaBooleanWhether quota is unlimited
model_limits_enabledBooleanWhether model access control is enabled
model_limitsStringModel restriction rules (JSON string; empty = no restrictions)
allow_ipsStringIP whitelist (comma-separated; empty = no restrictions)
used_quotaIntegerConsumed quota (internal units)
groupStringKey's billing group
cross_group_retryBooleanWhether cross-group retry is enabled
Pagination Fields
FieldTypeDescription
data.pageIntegerCurrent page number
data.page_sizeIntegerItems per page
data.totalIntegerTotal count

3.3 Get Specific API Key Details#

Retrieve complete details for an API Key by its numeric ID.
Endpoint
GET /api/token/{id}
Path Parameters
ParameterTypeDescription
idIntegerAPI Key's numeric ID
Request Headers
NameRequiredDescription
AuthorizationYesBearer <system_access_token>
apex-api-userYesTarget user's numeric ID
Request Example
Response Example
{
  "success": true,
  "message": "",
  "data": {
    "id": 11527,
    "user_id": 669,
    "key": "2UWqFGoE2AM2FY...",
    "status": 1,
    "name": "cl-of",
    "created_time": 1778739907,
    "accessed_time": 1779454195,
    "expired_time": -1,
    "remain_quota": -36107,
    "unlimited_quota": true,
    "model_limits_enabled": false,
    "model_limits": "",
    "allow_ips": "",
    "used_quota": 36107,
    "group": "cl-of-pro",
    "cross_group_retry": false
  }
}
Response fields are identical to Section 3.2 items[].

3.4 Search API Keys#

Search for API Keys by exact name match.
Endpoint
GET /api/token/search
Request Headers
NameRequiredDescription
AuthorizationYesBearer <system_access_token>
apex-api-userYesTarget user's numeric ID
Query Parameters
ParameterTypeRequiredDescription
keywordStringYesSearch keyword. Must exactly match the Key's display name
Request Example
Response Example
{
  "success": true,
  "message": "",
  "data": {
    "page": 1,
    "page_size": 10,
    "total": 1,
    "items": [
      {
        "id": 11848,
        "user_id": 669,
        "key": "0jCu7MEFsd6jzr...",
        "status": 1,
        "name": "openai-vip-pro",
        "unlimited_quota": true,
        "used_quota": 1279,
        "group": "gpt-vip-pro"
      }
    ]
  }
}
Important: This endpoint performs exact full-name matching and does not support fuzzy search. The keyword parameter must exactly match the Key's complete display name.

3.5 Get Subscription Information#

Retrieve subscription details for a specified user.
Endpoint
GET /api/subscription/self
Request Headers
NameRequiredDescription
AuthorizationYesBearer <system_access_token>
apex-api-userYesTarget user's numeric ID
Request Example
Response Example
{
  "success": true,
  "message": "",
  "data": {
    "subscriptions": [],
    "all_subscriptions": [],
    "billing_preference": "subscription_first"
  }
}
Response Fields
FieldTypeDescription
data.subscriptionsArrayCurrently active subscription plans
data.all_subscriptionsArrayAll subscription plans (including expired)
data.billing_preferenceStringBilling priority. "subscription_first" = prioritize subscription quota

Section IV: Endpoint Selection Guide#

EndpointAuthenticationUse CaseData Granularity
/v1/dashboard/billing/subscriptionAPI KeyThird-party client integration — view account quotaAccount-level
/v1/dashboard/billing/usageAPI KeyThird-party client integration — view cumulative spendingAccount-level
/v1/modelsAPI KeyQuery models accessible by the KeyAccount-level
/api/usage/token/API KeyProduction real-time validation of per-Key quota and model permissionsKey-level
/api/user/selfSystem TokenAdmin console — user information managementUser-level
/api/token/System TokenAdmin console — Key listing and lifecycle managementKey-level
/api/token/{id}System TokenAdmin console — individual Key detail viewKey-level
/api/token/searchSystem TokenAdmin console — Key name searchKey-level
/api/subscription/selfSystem TokenAdmin console — subscription managementUser-level
Recommended Approaches:
User Self-Service Queries: Use /v1/dashboard/billing/subscription + /v1/dashboard/billing/usage — OpenAI-compatible with zero integration effort
Production Quota Monitoring: Use /api/usage/token/ — highest precision, not restricted by group permissions
Backend Management System Integration: Use system token-authenticated management endpoints for programmatic operations

Section V: Error Code Reference#

ScenarioResponse ContentCauseResolution
Invalid API KeyHTTP 401 UnauthorizedKey is invalid, expired, or disabledVerify Key status in the console or create a new one
Invalid System Token{"code":401,"msg":"Not logged in or session expired"}System access token is incorrect or expiredRe-obtain from "Personal Settings > Account Management > Security Settings"
Invalid User ID{"code":401,"msg":"Not logged in or session expired"}apex-api-user value does not match a valid userUse the correct user numeric ID
Incorrect PathHTTP 404 page not foundPlatform and management proxy addresses were mixedUse platform.dataeyes.ai for /v1 endpoints, www.dataeyes.ai/apex for /api endpoints
Group Permission DeniedNo permission to access xxx groupAPI Key's group is not authorizedContact administrator to adjust group configuration, or use /api/usage/token/ instead
Search Failed{"success":false,"message":"Token search failed"}keyword parameter contains special characters or encoding issuesUse ASCII characters and ensure exact match with Key name

Section VI: SDK Integration Examples#

Python (OpenAI SDK)#

JavaScript / TypeScript (OpenAI SDK)#

cURL Quick Verification#


Section VII: Best Practices#

1.
Cache Results: Quota query results can be cached for 30–60 seconds to reduce API load
2.
Polling Frequency: Production monitoring should not exceed 1 query per minute
3.
Error Retry: Implement exponential backoff retry for transient failures
4.
Key Isolation: Use separate Keys for different business functions to enable independent consumption monitoring
5.
Quota Alerts: Trigger alert notifications when total_available falls below a threshold
6.
Search Limitations: /api/token/search only supports exact full-name matching; for fuzzy search, use the list endpoint with pagination

Previous
Data Updates
Next
API Key Management API