Registry Mirror
Skip to content

Latest commit

 

History

23 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Claude API

Generate text and build conversations with Claude models through Ace Data Cloud.

API documentation · Models and pricing · 中文文档

Get an API key

  1. Open Applications and sign in or register.
  2. Find General Application and click the copy button marked 1. If needed, select Initialize General Application first. Confirm access to this service and enough balance for your request.

Copy the API key from General Application using the button marked 1

  1. Save the copied key in your terminal. The examples add the Bearer prefix in the HTTP header.
export ACEDATACLOUD_API_KEY='YOUR_API_KEY'

Detailed API key guide · Current pricing

Quickstart

Request

curl --fail-with-body --silent --show-error https://api.acedata.cloud/v1/messages \
  --header "Authorization: Bearer $ACEDATACLOUD_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "claude-sonnet-5-5",
  "messages": [
    {
      "role": "user",
      "content": "Explain what an API is in one sentence."
    }
  ],
  "stream": false,
  "max_tokens": 128
}'

Response JSON

Illustrative response with placeholder identifiers and output values.

{
  "id": "msg_example",
  "type": "message",
  "role": "assistant",
  "model": "claude-sonnet-5-5",
  "content": [
    {
      "type": "text",
      "text": "An API lets software request data or actions from another service."
    }
  ],
  "stop_reason": "end_turn",
  "stop_sequence": null,
  "usage": {
    "input_tokens": 18,
    "output_tokens": 15
  }
}

Read content[0].text for the answer and usage for token counts.

APIs and Guides

Explore the supported endpoints and integration guides for Claude.

API Path Integration Guidance
Claude Chat Completion API /v1/chat/completions Claude Chat Completion API Integration Guide
Claude Messages API /v1/messages Claude Messages API Integration Guide
Claude Messages Count Tokens API /v1/messages/count_tokens Claude Messages Count Tokens API Integration Guide

Gemini and Grok on Messages

The shared /v1/messages endpoint also accepts gemini-3.8-flash, gemini-4-argon, gemini-4-carbon, gemini-4-hydrogen, gemini-4-neon, grok-4.7, grok-4.5, grok-4 and grok-3. Keep messages and the required max_tokens; read text from content blocks rather than choices. Follow the Messages guide for history, streaming and tool results. This does not add these models to Count Tokens.

GPT-6.2 on Messages

Select gpt-6.2-astra or gpt-6.2-sol on /v1/messages while keeping the Messages request and response format. Send messages and max_tokens, and read the returned content and usage fields. Check the selected model's current pricing and account availability; model-specific Claude features depend on the selected model. See the Messages guide.

Claude Fable 5.2

Use the exact model ID claude-fable-5-2 on Messages or Chat Completions. Prefer Messages for native thinking blocks and tool interaction. Adaptive thinking remains on; omit temperature, top_p, and top_k, use automatic tool choice, and provide enough max_tokens for both thinking and final text. This model currently does not support the Count Tokens or Responses endpoints on Ace Data Cloud.

At the current maximum package (142,800 Credits for $13,584), standard input costs $3.20 and output costs $16 per million tokens. Cache reads cost $0.08, five-minute cache writes $4, and one-hour cache writes $6.40 per million tokens. These are 40% of Anthropic's standard API rates (60% lower) at that package rate; other packages and account discounts must be checked on the live pricing page.

Token and Cache Billing

Compatible model requests accepted by the platform are billed for the selected model's input, output, and cache usage, not a fixed fee for switching API formats. Chat Completions usage.prompt_tokens includes cached tokens, with reported cache usage charged at the corresponding cache rates. Messages usage.input_tokens excludes separately reported cache-read and cache-creation tokens, which are settled separately. Check the console's current model prices and the response's usage.cost when present; Messages streaming responses may omit cost or return it as null. See the Messages guide for the usage fields.

Troubleshooting

  • For authentication errors, open Manage Keys to check the key’s allowed APIs, expiration and usage limit.
  • For insufficient balance, open the application and review its balance and the current service price.
  • For request validation errors, compare the model and required fields with the linked API reference.
  • For a long-running or failed task, retain task_id and trace_id when contacting support.

Trial account concurrency

Accounts with neither a successful paid top-up nor an administrator's manual credit addition may run one billable request at a time across the entire account, shared by all API keys and services. Rewards, redemption cards and transferred credits do not count as paid top-ups. A successful paid top-up or manual credit addition removes this trial restriction; balance and key usage-limit checks still apply.

A new billable request returns 429 too_many_requests while another is running. Wait for the active request's final result before submitting the next one. Free task polling remains available.

For async APIs, acceptance or a task ID is not completion: keep querying the same task until its final result. A disconnect or proxy timeout does not mean execution stopped. If a task has no terminal result for a long time, contact support with trace_id.

This restriction changes neither trial API availability nor pricing; fees are settled after execution based on actual usage.

About

Claude API: text generation and conversations. English API documentation, authentication and Quickstart examples.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors