Http api cloudbase

From TencentCloudBase/CloudBase-AI-Toolkit · View interactive version

Http api cloudbase is an AI agent skill from the GitHub repository TencentCloudBase/CloudBase-AI-Toolkit. CloudBase official HTTP API client guide. This skill should be used when backends, scripts, or non-SDK clients must call CloudBase platform APIs over raw HTTP instead of using a platform SDK or MCP management tool.

How to use this skill

Skill file

Sibling skills (local only)

Sibling CloudBase skills ship beside this skill. Use local relative paths such as ../auth-tool-cloudbase/SKILL.md.

If a referenced sibling skill file is missing from this environment, ask the user to install the full CloudBase plugin (or the missing skill). Do not HTTP-fetch remote skill or protocol markdown into the agent context.

Activation Contract

Use this first when

Read before writing code if

Then also read

Do NOT use for

Common mistakes / gotchas

Minimal checklist

When to use this skill

Use this skill whenever you need to call CloudBase platform features via raw HTTP APIs, for example:

Do not use this skill for:

How to use this skill (for a coding agent)

  1. Clarify the scenario
  1. Determine the base URL
  1. Set up authentication
  1. Reference OpenAPI Swagger documentation

Overview

CloudBase HTTP API is a set of interfaces for accessing CloudBase platform features via HTTP protocol, supporting database, user authentication, cloud functions, cloud hosting, cloud storage, AI, and more.

OpenAPI Swagger Documentation

⚠️ IMPORTANT: Always use searchKnowledgeBase tool to get OpenAPI Swagger specifications

Before implementing any HTTP API calls, you should:

  1. Use searchKnowledgeBase tool to get OpenAPI documentation:

```

searchKnowledgeBase({ mode: "openapi", apiName: "<api-name>" })

```

  1. Available API names:
  1. Parse and use the swagger documentation:
  1. Never invent API endpoints or parameters - always base your implementation on the official swagger documentation.

Undocumented endpoints are off limits

Call only the endpoints, methods, parameters, and response fields published in the CloudBase HTTP API docs or in the OpenAPI definition returned by searchKnowledgeBase. A successful response does not make an endpoint public.

| Counts as public API | Does not count |

| --- | --- |

| Path and method in the OpenAPI definition | Path found by probing the gateway, reading error messages, or capturing requests |

| Path and method on the docs site | Path that returns 200 but has no documentation entry |

| Parameters and response fields in the docs | PostgREST features CloudBase has not published, such as unlisted /rpc/ routes or Prefer values |

⚠️ Undocumented endpoints have no compatibility commitment and no SLA. They can change or be removed without notice. Do not generate code against them, and do not offer them to the user as a supported option.

Prerequisites

Before starting, ensure you have:

  1. CloudBase environment created and activated
  2. Authentication credentials (AccessToken, API Key, or Publishable Key)

Authentication and Authorization

CloudBase HTTP API requires authentication. Choose the appropriate method based on your use case:

AccessToken Authentication

Applicable environments: Client/Server

User permissions: Logged-in user permissions

How to get: Use searchKnowledgeBase({ mode: "openapi", apiName: "auth" }) to get the Authentication API specification

API Key

Applicable environments: Server

User permissions: Administrator permissions

⚠️ Warning: Tokens are critical credentials for identity authentication. Keep them secure. API Key must NOT be used in client-side code.

Publishable Key

Applicable environments: Client/Server

User permissions: Anonymous user permissions

💡 Note: Can be exposed in browsers, used for requesting publicly accessible resources, effectively reducing MAU.

API Endpoint URLs

CloudBase HTTP API uses unified domain names for API calls. The domain varies based on the environment's region.

Domestic Regions

For environments in domestic regions like Shanghai (ap-shanghai), use:

https://{your-env}.api.tcloudbasegateway.com

Replace {your-env} with the actual environment ID. For example, if environment ID is cloud1-abc:

https://cloud1-abc.api.tcloudbasegateway.com

International Regions

For environments in international regions like Singapore (ap-singapore), use:

https://{your-env}.api.intl.tcloudbasegateway.com

Replace {your-env} with the actual environment ID. For example, if environment ID is cloud1-abc:

https://cloud1-abc.api.intl.tcloudbasegateway.com

Using Authentication in Requests

Add the token to the request header:

Authorization: Bearer <access_token/apikey/publishable_key>

:::warning Note

When making actual calls, replace the entire part including angle brackets (< >) with your obtained key. For example, if the obtained key is eymykey, fill it as:

Authorization: Bearer eymykey

:::

Extended guide

For detailed scenarios, examples, and patterns, read extended-guide.md.

Reference index

All packaged reference files (required for skill lint reachability):

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.