SupportConsole
Tickets
Navigation

Getting Started
Registration and Account SetupFirst Order: From Registration to Power-OnConsole Navigation and Common Entry PointsGetting Started: Terms and Concepts
Cloud Server Operations
Connection and Login: SSH Key, Password, VNC / noVNCUnable to Connect and Self-Service Outage TroubleshootingPower On, Shutdown, and RestartSystem Reinstallation, Public Images, and Custom ISOSnapshots and BackupsDisk Configuration and ResizingBandwidth, Traffic, and PortsIP AddressesMigration, Cloning, and Changing Data CentersCreation, Deployment, and DeliverySuspension, Deletion, and RecoveryPerformance AnomaliesCommon Console Error ReferenceUsage Limits and Common QuestionsHow to Manually Configure IPv6 in Nube CloudHow to Access Nube Cloud Virtual Machines Using SSH KeysQuotas, Credit Line, and Balance
Bare Metal Servers
Bare Metal Server (Dedicated Server / Bare Metal) RentalBare Metal Delivery and Rack InstallationBare Metal Customization and ColocationBare Metal Cancellation, Reclamation, and RefundsPioneer Program
Network, IP & Routes
Network Route Types: International Lite, International Optimized, and China OptimizedSelf-Service Network Troubleshooting: Unreachable, Packet Loss, Latency, and JitterHome Broadband IPs and Residential Broadband: Activation and TrialIP Prefix Leasing, Announcements, ASN, and RPKI RequestsChanging Network Lines, Replacing IPs, and Adjusting RoutesPort Blocking and GFW Blocking: IP Replacement, Port 25, and UnblockingTest IPs, Looking Glass, and Paid TestingCommon Network IssuesHong Kong Anti-DDoS China-Optimized Service Quota GuideWhat's the Difference Between International Lite and International Optimized?DDoS Protection and China Optimized Quota
DDoS
CDN Activation, Configuration, and MigrationCDN Plans, Renewal, and Traffic Rules
AI API
Model List, Capabilities, and AvailabilityError-Code Troubleshooting: 400, 403, 429, 503, and Thinking BlocksRate Limits, Concurrency, and Quota RulesBilling and Usage: Token Accounting, Caching, and Billing DisputesAI API Integration GuideModel Technical Notes: Deployment, Quantization, and Capabilities
Support/
Service & Products

AI API Integration Guide

Nube AI is Nube Cloud’s open-source large-model API service. It provides a unified API for calling multiple mainstream open-source models at relatively low prices. This article covers all information and steps required for integration.

1. Basic concepts

ItemDescription
Product formMaaS / TaaS (Model as a Service / Token as a Service)
Service modelUsage-based billing, with no contract lock-in
DeploymentPlatform-owned GPU clusters deploy open weights (not a resale of an official API)
ProtocolsOpenAI-compatible (recommended) and Anthropic-compatible; the same API Key can be used with both
Base URLsOpenAI-compatible: https://ai.nube-api.com/v1; Anthropic-compatible: https://ai.nube-api.com
Consolehttps://console.nube.sh → AI Model / API

Choose the Base URL for the API format supported by your client

The same API Key works with both OpenAI- and Anthropic-compatible APIs. Select the corresponding API format in the client before entering its Base URL.

API formatBase URLCommon client options
OpenAI-compatible APIhttps://ai.nube-api.com/v1OpenAI Compatible, Custom OpenAI
Anthropic-compatible APIhttps://ai.nube-api.comAnthropic Compatible, Custom Claude
  • Enter the Base URL exactly as listed above. The OpenAI Base URL already includes /v1; do not append /v1 again to the Anthropic Base URL.
  • Do not mix the Base URLs for the OpenAI- and Anthropic-compatible protocols.
  • If a client requires a full endpoint instead of a Base URL, configure it separately according to the client’s documentation. The Anthropic Messages endpoint is https://ai.nube-api.com/v1/messages.

2. Four integration steps

① Register and add funds (adding about 5 USDT is recommended for a small test)
② Create an API Key in the Console (a budget limit and reset period can be set)
③ Add a custom provider in the client, select the OpenAI- or Anthropic-compatible protocol, and enter the corresponding Base URL, API Key, and Model ID
④ Send a simple chat request to verify the connection

Key entry points

PurposeAddress
Playground (online testing)https://console.nube.sh/ai-model/api/playground
Key managementConsole → AI Model / API → Key management
Usage and logsConsole → AI Model / API → Usage
Pricing catalog (API)https://ai.nube-api.com/v1/models/pricing

The same API Key can be used with the OpenAI-compatible protocol, the Anthropic-compatible protocol, and mainstream AI tools. The Console API management page provides both Base URLs.

Playground-only API Key restrictions: it cannot be copied, deleted, or renamed.

The pricing catalog currently returns model names, input / output / cache-read prices, currency, capability tags (public_tags), and maximum context (public_context_window). It can be queried publicly without an API Key.

3. Model IDs

Specify the Model ID, rather than the display name:

Model IDDescription
AgentSmart-routing preferred model. It automatically selects the currently best-performing model and may change as the platform adjusts; recommended for everyday office work
deepseek-v4.1-flashDeepSeek V4.1 Flash, with native vision, reasoning, and tool calling, and 1,000,000-token context
glm-5.3 / glm-5.3-flashZhipu GLM series
kimi-k2.6 / kimi-k3Moonshot Kimi series

Where to find Model IDs: copy them from the Console API page, or use the GET /v1/models endpoint. Same name, different minor version: within a major version, the platform automatically applies the latest minor version, and the Model ID generally stays the same. Major-version changes are announced in advance.

4. Request examples

curl (OpenAI-compatible)

curl https://ai.nube-api.com/v1/chat/completions \
  -H "Authorization: Bearer $NUBE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "Agent",
    "messages": [{"role": "user", "content": "Hello. Introduce yourself in one sentence."}]
  }'

Python (OpenAI SDK)

from openai import OpenAI


client = OpenAI(
    api_key="sk-...",
    base_url="https://ai.nube-api.com/v1",
)


resp = client.chat.completions.create(
    model="Agent",
    messages=[{"role": "user", "content": "Hello"}],
)
print(resp.choices[0].message.content)

Anthropic-compatible requests

Use https://ai.nube-api.com as the Anthropic-compatible Base URL. The messages endpoint is:

https://ai.nube-api.com/v1/messages

Some clients (including Claude Code and Grok Build) depend heavily on the Anthropic thinking format and may still report errors such as Content block is not a thinking block or missing field 'summary'.

Any client that supports a custom OpenAI Base URL can connect, including OpenCode, Cline, Kilo Code, Cherry Studio, VS Code Copilot (custom models), and custom agents.

5. Choosing a model

  • Not sure which to use → start with Agent (recommended routing).
  • Vision / image input → models with vision include deepseek-v4.1-flash, kimi-k3, kimi-k2.6, and glm-5.3-flash; not all models support images (for example, glm-5.3 is text-only).
  • Stability first → configure a fallback for the primary model (for example, primary deepseek-v4.1-flash, backups glm-5.3 / kimi-k3).
  • High concurrency / batch → see Rate Limits, Concurrency, and Quota Rules.

6. Security and budget controls

FeatureDescription
Key-level budgetSet max_budget for each Key; the platform blocks calls automatically after the limit is reached
Account-level budgetAn overall account budget limit
Key aliasUseful for reconciliation, such as naming by project
Disable / enableDisable a Key in the Console

Security recommendations:

  • Do not paste a Key into a ticket, chat record, or code repository. If it is exposed, rebuild it immediately in the Console.
  • Set a reasonable budget limit for the Key to reduce abuse or unexpected consumption from a client loop.
  • Configure the Auto Top-Up master switch carefully to avoid unexpected charges; see Add-Funds Amounts and Minimum Limits.

7. Compatibility notes (important)

The platform is OpenAI-compatible. The following fields and protocols have known differences:

ItemCurrent behavior
reasoning_effortSupports none / low / medium / high / xhigh / max / adaptive; minimal returns 400
thinking: {"type":"enabled"}Returns 400 (the backend maps this to reasoning_effort, which must be valid)
thinking: {"type":"disabled"}Returns 200, but may still send reasoning_content
Preserve thinkingUse thinking: {"clear_thinking": false} without type
tool_streamUnsupported, returns 400 (Extra inputs are not permitted)
Multi-turn tool callingA tool-call assistant message must be immediately followed by a role=tool message for each corresponding tool_call_id; otherwise 400
Thinking-mode replaySend the previous reasoning_content unchanged in the next request, or the request may return 400
Anthropic protocolUse Base URL https://ai.nube-api.com and /v1/messages; clients with strict thinking-format requirements may still report compatibility errors
Responses APILimited compatibility; it may report missing field 'summary'
logprobs / top_logprobsCurrently unsupported
EmbeddingsNot yet available; calls return 403
Image inputSupported by some models; unsupported models report Current model does not support image input
Word upload on the WebWeb parsing of .docx is limited; convert it to PDF or paste the text (the API can process .docx content)

For error handling, see Error-Code Troubleshooting: 400, 403, 429, 503, and Thinking Blocks.

⚠️ Pricing notice: current model prices can be queried through the API. Future price changes will no longer be announced by email; use the API or the model pricing page instead (see the important notice on the Console AI Model overview page).

8. Data privacy

The platform operates under a zero-data-retention policy:

  • In normal production mode, no content-related logs are retained; prompts and model responses are not saved.
  • Exception: troubleshooting may temporarily enable log retention, which is automatically deleted after 24 hours.
  • Maximum Spend Logs: contain billing metadata only, never prompts or model responses; the retention period is 30 days.
  • Data is not used to train models.
  • “No additional moderation” means that the platform does not add a filtering layer on top of the model; the model provider’s own alignment remains in effect, and use must comply with applicable law and the platform Terms of Service.

For the strictest data-sovereignty requirements, consider an official enterprise edition or self-hosted deployment.

9. Frequently asked questions

QuestionAnswer
What is the OpenAI Base URL?https://ai.nube-api.com/v1
What is the Anthropic Base URL?https://ai.nube-api.com; the messages endpoint is /v1/messages
Can one Key use both protocols?Yes. The same API Key supports the OpenAI-compatible and Anthropic-compatible protocols
Will price changes be emailed?No. Use the API or pricing page
Can one Key call different models?Yes. Change only the model field
What if a Model ID changes?Minor versions update automatically within a major version; the ID generally stays the same. Major-version changes are announced
Can a region be selected?Region-specific node selection is not currently supported
Is there a public API for batch Key creation or management?No
Can I test it?There is no free quota; adding around 5 USD for a practical test is recommended
Is streaming supported?Yes; note the compatibility issues around thinking fields
How do I reconcile usage?Contact official support and provide the Key alias or a specific Request ID

10. Related articles

  • Models and capabilities: Model List, Capabilities, and Availability
  • Error troubleshooting: Error-Code Troubleshooting: 400, 403, 429, 503, and Thinking Blocks
  • Rate limits and concurrency: Rate Limits, Concurrency, and Quota Rules
  • Billing and usage: Billing and Usage: Token Definitions, Caching, and Billing Appeals
  • Technical notes: Technical Notes: Quantization, Precision, Context Length, and Multimodality