Skip to content
AceDataCloudPublic

About

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

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

21 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Gemini API

Generate text and build conversations with Gemini 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/gemini/chat/completions \
  --header "Authorization: Bearer $ACEDATACLOUD_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "gemini-4-neon",
  "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": "gemini-4-neon",
  "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.

APIs and Guides

Explore the supported endpoints and integration guides for Gemini.

API Path Integration Guidance
Gemini Chat Completion API /gemini/chat/completions Gemini Chat Completion API Integration Guide
Gemini Generate Content API /v1/models/{model}:generateContent Gemini Generate Content API Integration Guide

Native Generate Content and pricing

gemini-4-argon, gemini-4-carbon, gemini-4-hydrogen and gemini-4-neon also support POST /v1/models/{model}:generateContent and POST /v1/models/{model}:streamGenerateContent?alt=sse. These native methods use contents, not messages; existing /v1beta clients retain the same key and pricing.

Native input, output and cache-read rates are 70% of the corresponding Google Gemini API Standard rates when converted using the maximum-package Credits exchange rate. Thinking tokens count as output; account usage discounts apply separately. This native pricing is not a Chat Completions price guarantee. See the native guide for usage accounting and the current service pricing before calling.

Responses and Messages formats

gemini-3.8-flash, gemini-4-argon, gemini-4-carbon, gemini-4-hydrogen and gemini-4-neon also accept the Responses format on /v1/responses (alias /openai/responses) and the Messages format on /v1/messages.

For Responses, send model and input; read output_text content blocks in output. Omit store or set it to false, omit previous_response_id, and keep history in input. Function tools run on the client and return function_call_output with the original call_id.

For Messages, send model, messages and max_tokens; read content text blocks and usage. Pass history in messages; return tool results with the matching tool_use_id. Streaming uses Responses events or Messages events according to the endpoint, not native Generate Content chunks. For native input and parameter support, follow the Generate Content guide, not these protocol-specific request formats.

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

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

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors