DataEyesAI
Official SiteConsoleDocs HomeGetting StartedDeveloper ToolsAI Models API
Terms & Policies
Official SiteConsoleDocs HomeGetting StartedDeveloper ToolsAI Models API
Terms & Policies
  1. AI Models API
  • API Overview
  • Chat Completions
  • Responses
  • Messages (Claude)
  • Gemini (generateContent)
  • Embeddings
  • Image Models
    • Images
    • Gemini Image Generation
    • Grok Imagine 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
  • Video Model
    • FLUX Video Generation (flux-3-video)
    • 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
      • 17-Kling-4.0-Video-Generation
    • 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
  1. AI Models API

Messages (Claude)

The native Anthropic Messages API. All Claude models and glm-5.1 support it, along with Claude-native features such as extended thinking and prompt caching. Claude Code uses this API too.
POST https://studio.dataeyes.ai/v1/messages

Authentication#

Either header works:
HeaderExampleUsed by
x-api-keyx-api-key: sk-xxxAnthropic SDK default
AuthorizationAuthorization: Bearer sk-xxxClaude Code (ANTHROPIC_AUTH_TOKEN) and other tools
Also send anthropic-version: 2023-06-01 (the SDK adds it automatically).

Quick example#

cURL
Python
Node.js
No /v1 in the Base URL
The Anthropic SDK appends /v1/messages itself, so set base_url to https://studio.dataeyes.ai.
Response:
{
  "id": "msg_xxx",
  "type": "message",
  "role": "assistant",
  "model": "claude-sonnet-5-5",
  "content": [
    {
      "type": "text",
      "text": "I'm Claude, an AI assistant made by Anthropic, here to help with questions, writing, analysis, and more."
    }
  ],
  "stop_reason": "end_turn",
  "usage": {
    "input_tokens": 31,
    "cache_creation_input_tokens": 0,
    "cache_read_input_tokens": 0,
    "output_tokens": 40
  }
}

Request parameters#

ParameterTypeRequiredDescription
modelstringYesModel name, exactly as shown in the Model Hub
max_tokensintegerYesUpper limit on output tokens (including thinking tokens)
messagesarrayYesConversation messages; role is user or assistant, alternating
systemstring / arrayNoSystem instructions. Use the array form for prompt caching; see "Prompt caching" below
streambooleanNoIf true, the response is streamed as SSE events
temperaturenumberNoSampling temperature, 0 to 1
stop_sequencesarrayNoCustom stop sequences
toolsarrayNoTools the model can call. See "Tool use" below
tool_choiceobjectNo{"type": "auto"} (default), {"type": "any"}, or {"type": "tool", "name": "..."}
thinkingobjectNoExtended thinking settings. See "Extended thinking" below
output_configobjectNoFor example {"effort": "high"}; works with adaptive thinking to control thinking depth

Streaming#

With "stream": true, events arrive in this order:
message_start → content_block_start → content_block_delta (repeated) → content_block_stop
→ message_delta (with stop_reason and final output_tokens) → message_stop
event: content_block_delta
data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Hello!"}}
Python SDK example:

Extended thinking#

Claude 5 models use adaptive thinking: the model decides whether and how long to think based on the problem, and output_config.effort sets the tendency (low, medium, high).
When the model thinks, content returns a thinking block first, then a text block. Thinking tokens count toward output_tokens:
{
  "content": [
    { "type": "thinking", "thinking": "…", "signature": "…" },
    { "type": "text", "text": "…" }
  ],
  "stop_reason": "end_turn"
}
NOTE
In adaptive mode, the model may skip thinking on simple questions and return only a text block. This is expected.
Claude 4.x models use a fixed budget instead: "thinking": {"type": "enabled", "budget_tokens": 2048}, where budget_tokens must be less than max_tokens.

Image input#

Add an image block to the content array. Base64 is recommended:
Base64 (recommended)
Image URL
The corresponding block in a raw HTTP request: {"type": "image", "source": {"type": "base64", "media_type": "image/jpeg", "data": "<Base64>"}}.
URL sources may return 400
Some routes do not support URL image sources and return URL content sources are not yet supported for this model. Use Base64 in production.

Tool use#

Step 1: send the request with tool definitions
The model returns a tool_use block, and stop_reason is tool_use:
{
  "content": [
    {
      "type": "tool_use",
      "id": "toolu_xxx",
      "name": "get_weather",
      "input": { "city": "Shanghai" }
    }
  ],
  "stop_reason": "tool_use"
}
Step 2: run the tool and send the result back with tool_result
The model answers based on the result, for example: Shanghai is cloudy today, and the temperature is 22°. …

Prompt caching#

Add cache_control to long content that you reuse (system prompts, long documents, tool definitions). When later requests hit the cache, that part of the input is billed at the cache-read rate.
How usage changes when the same content is sent twice in a row (measured, with about 2,500 cached tokens):
Requestcache_creation_input_tokenscache_read_input_tokensinput_tokens
1st: writes the cache2535022
2nd: hits the cache0253522
TIP
Content that is too short is not cached (the minimum length varies by model), and it must match the earlier request exactly. Content up to and including the cache_control marker is cached. For cache read and write pricing, see the Model Hub.

Response fields#

FieldDescription
idUnique ID of the request
contentArray of content blocks; type can be text, thinking or tool_use
stop_reasonend_turn normal end, max_tokens limit reached, tool_use a tool needs to be called, stop_sequence a stop sequence matched
usage.input_tokensInput tokens not served from cache
usage.cache_creation_input_tokensTokens written to the cache
usage.cache_read_input_tokensTokens read from the cache
usage.output_tokensOutput tokens (including thinking tokens)

FAQ#

Claude Code returns 400
Can GPT or Gemini use this API?
404
Previous
Responses
Next
Gemini (generateContent)