Skip to content
AceDataCloudPublic

Latest commit

 

History

144 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

OpenAI API

Generate text and build conversations with OpenAI 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/openai/chat/completions \
  --header "Authorization: Bearer $ACEDATACLOUD_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "gpt-6.2-sol",
  "messages": [
    {
      "role": "user",
      "content": "Explain what an API is in one sentence."
    }
  ],
  "stream": false
}'

Response JSON

Illustrative response. Your request returns its own ID, text and token usage.

{
  "id": "chatcmpl-example",
  "object": "chat.completion",
  "created": 1790000000,
  "model": "gpt-6.2-sol",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "An API lets software request data or actions from another service."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 18,
    "completion_tokens": 15,
    "total_tokens": 33
  }
}

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

Generate an image with GPT Image 2.6

Use gpt-image-2.6-flare for this first image. Compare the available GPT Image 2.6 model options and prices in the model directory.

curl --fail-with-body --silent --show-error https://api.acedata.cloud/openai/images/generations \
  --header "Authorization: Bearer $ACEDATACLOUD_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "gpt-image-2.6-flare",
  "prompt": "A blue ceramic coffee mug on a white table, soft morning light, product photograph",
  "response_format": "url"
}'

Response JSON

Illustrative response. Your request returns the generated image URL.

{
  "created": 1790000000,
  "data": [
    {
      "url": "https://media.example.com/image.png"
    }
  ]
}

Open data[0].url from the response. For reference-image edits, use the image editing guide.

APIs and Guides

Explore the supported endpoints and integration guides for OpenAI generation.

API Path Integration Guidance
OpenAI Chat Completions API /openai/chat/completions OpenAI Chat Completion API Integration Guide
OpenAI Images Generations API /openai/images/generations OpenAI Images Generations API Integration Guide
OpenAI Responses API /openai/responses OpenAI Responses API Integration Guide
OpenAI Embeddings API /openai/embeddings OpenAI Embeddings API Integration Guide
OpenAI Images Edits API /openai/images/edits OpenAI Images Edits API Integration Guide

Chat and Responses Billing

Accepted compatible-model requests on /openai/chat/completions (alias /v1/chat/completions) and /openai/responses (alias /v1/responses) 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 and Responses usage.input_tokens include cached tokens; reported cache usage is charged at the corresponding cache rates. Check the console's current model prices and the response's usage.cost when present. See the Chat Completions guide and Responses guide for details.

Gemini on Responses

The Responses endpoint also accepts gemini-3.8-flash, gemini-4-argon, gemini-4-carbon, gemini-4-hydrogen and gemini-4-neon for text or image input and text output. Use /openai/responses or /v1/responses with model and input; read output_text content blocks inside output. Omit store or set it to false, omit previous_response_id, and pass client-managed history in input. See the Responses guide for streaming and client-executed function tools.

Regional catalog availability

The OpenAI image generation and editing APIs and their companion guides are hidden from the mainland-China catalog. Check the catalog available to your region before following the image examples below; these global reference examples do not establish regional availability.

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.

Realtime connection authentication does not occupy this ordinary-request slot and retains its existing per-turn billing.