К основному содержанию
скилл CX Codex

http-api-cloudbase — скилл для Claude Code: обзор и установка

Скилл учит агента работать с HTTP API платформы Tencent CloudBase напрямую без SDK. Пригодится бэкендам на Python или Go, мобильным клиентам и curl-скриптам.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add TencentCloudBase/skills --skill http-api-cloudbase -a claude-code
Открыть на GitHub

Что делает http-api-cloudbase

Скилл направляет ИИ-агента при обращении к сервисам Tencent CloudBase по протоколу HTTP. Он нужен в ситуациях, когда официальные библиотеки вроде @cloudbase/node-sdk не подходят: в мобильных приложениях на Flutter, бэкендах на Go или Python, а также в скриптах автоматизации. Агент перестаёт угадывать эндпоинты и следует регламенту платформы.

Внутри заложен чёткий алгоритм действий. Ассистент выясняет ID окружения, выбирает способ авторизации и определяет базовый домен. Секретный административный API Key нельзя отдавать клиентам. Чтобы составить точные запросы к базам данных, хранилищу и облачным функциям, агент запрашивает официальные спецификации через инструмент searchKnowledgeBase в режиме OpenAPI.

Какие задачи решает

  • вызвать функции CloudBase из бэкенда на Go или Python
  • настроить прямые HTTP-запросы к базам MySQL и NoSQL без SDK
  • подключить авторизацию по SMS через HTTP API
  • обратиться к облачному хранилищу CloudBase из curl-скрипта

Примеры запросов агенту

  • Напиши на Python скрипт для вызова облачной функции CloudBase через HTTP API
  • Сделай HTTP-запрос к REST API базы MySQL в CloudBase с авторизацией по API Key
  • Подключи авторизацию пользователей по SMS через HTTP API CloudBase для приложения на Flutter

Как установить http-api-cloudbase

1Через Skills CLI (Vercel)

npx skills add TencentCloudBase/skills --skill http-api-cloudbase -a claude-code

2Вручную: положить файлы

~/.claude/skills/http-api-cloudbase/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/http-api-cloudbase/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Из того же набора16

ai-model-wechat Скилл для вызова ИИ-моделей внутри мини-программ WeChat через wx.cloud.extend.AI. Пригодится, если пишете генерацию текста в мини-аппе и не хотите угадывать сигнатуры. CX Codex +1 1 100установок auth-tool-cloudbase Готовит авторизацию CloudBase к работе: проверяет провайдеров, ключи и способы входа до того, как вы начнёте писать код. CX Codex +1 1 000установок ai-model-nodejs Скилл для вызова ИИ-моделей из Node.js-бэкенда через @cloudbase/node-sdk: генерация текста и картинок, облачные функции, CloudRun. CX Codex +1 998установок cloudrun-development Правила разработки бэкенда на CloudBase Run: развёртывание сервисов с долгими соединениями, доступом к VPC-базам и разбор сбоев контейнеров. CX Codex +1 983установок auth-nodejs-cloudbase Скилл помогает настроить серверную авторизацию в CloudBase через Node.js: проверить профиль вызывающего пользователя, выдать тикет для входа или получить IP-адрес клиента. CX Codex +1 960установок relational-database-mcp-cloudbase Скилл описывает, как агенту работать с реляционной базой CloudBase через MCP: читать данные, менять схему, править права. Помечен как устаревший. CX Codex +1 956установок auth-web-cloudbase Настраивает вход, регистрацию и сессии в веб-приложениях на базе @cloudbase/js-sdk. Предотвращает частые ошибки авторизации и защищает роуты. CX Codex +1 951установок relational-database-web-cloudbase Показывает, как инициализировать @cloudbase/js-sdk в браузере и получить общий клиент реляционной базы CloudBase для запросов в стиле Supabase. CX Codex +1 899установок

Похожие

caveman-manage JuliusBrussee Проверяет состояние и результаты экспериментов Caveman Cloud, предлагает одно действие или блокирует рискованный запрос. Нужен перед запуском, одобрением, отменой или откатом. CX Codex +1 104 200установок workers-best-practices cloudflare Скилл настраивает ИИ на проверку продакшен-кода Cloudflare Workers по актуальным правилам рантайма, типам Wrangler и антипаттернам. CX Codex +1 126 100установок cloudflare-email-service cloudflare Скилл для работы с Cloudflare Email Sending и Email Routing: помогает настроить отправку и приём писем в Workers. CX Codex +1 102 300установок firebase-basics официальный google Скилл настраивает Firebase CLI, помогает войти в аккаунт, создать или выбрать проект и скачать конфигурацию Android или iOS. CX Codex 14 100установок cloudflare-one cloudflare Помогает агенту проектировать, настраивать и разбирать развёртывания Cloudflare One Zero Trust и SASE. Пригодится, когда нужно спланировать Access, Gateway или туннели без похода в документацию вручную. CX Codex +1 93 100установок cloudflare-one-migrations cloudflare Помогает спланировать переход с VPN, SWG или SASE на Cloudflare One: сопоставляет политики, находит пробелы и расписывает порядок выката. CX Codex +1 89 500установок

Рядом в теме «Облака: AWS, Azure, GCP»

Всё по теме «Облака: AWS, Azure, GCP» →

Вопросы о http-api-cloudbase

Как установить http-api-cloudbase в Claude Code?

Выполните команду npx skills add TencentCloudBase/skills --skill http-api-cloudbase -a claude-code. Файл скилла будет сохранён по пути ~/.claude/skills/http-api-cloudbase/SKILL.md.

Зачем нужен скилл http-api-cloudbase?

Он объясняет агенту правила обращения к сервисам CloudBase через сырой HTTP. Это требуется при разработке на языках без официального SDK платформы.

Какие способы авторизации поддерживает интеграция?

Поддерживаются AccessToken для вошедших пользователей, серверный API Key с правами администратора и публичный Publishable Key для анонимных клиентских запросов.

Исходный текст

SKILL.md · MIT
---
name: http-api-cloudbase
description: 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.
version: 2.36.1
license: MIT
alwaysApply: false
---

## 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

- The request comes from Android, iOS, Flutter, React Native, non-Node backends, or admin scripts that must call official CloudBase APIs via raw HTTP.
- The task is to consume CloudBase platform endpoints, not to build a new HTTP service on CloudBase.

### Read before writing code if

- The platform does not support a CloudBase SDK, or the user explicitly asks for HTTP API integration.
- The user says "HTTP API" but it is unclear whether they mean official CloudBase endpoints or their own business API.

### Then also read

- Auth configuration -> `../auth-tool-cloudbase/SKILL.md`
- MySQL MCP management -> `../relational-database-mcp-cloudbase/SKILL.md`
- Your own HTTP service on CloudBase -> `../cloud-functions/SKILL.md` or `../cloudrun-development/SKILL.md`

### Do NOT use for

- CloudBase Web SDK flows, mini program SDK flows, or MCP-driven management tasks.
- Building your own HTTP service or REST API on CloudBase.

### Common mistakes / gotchas

- Treating Web SDK examples as valid for native Apps.
- Guessing endpoints without reading OpenAPI definitions.
- Confusing official CloudBase HTTP APIs with your own function or CloudRun endpoint.
- Mixing raw HTTP API integration with MCP management logic.

### Minimal checklist

- Read [HTTP API Routing Checklist](checklist.md) before implementation.

## When to use this skill

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

- Non-Node backends (Go, Python, Java, PHP, etc.)
- Integration tests or admin scripts that use curl or language HTTP clients
- Direct database operations via 关系型数据库 RESTful API (MySQL/PostgreSQL)
- Cloud function invocation via HTTP
- Any scenario where SDKs are not available or not preferred

Do **not** use this skill for:

- Frontend Web apps using `@cloudbase/js-sdk` (use **CloudBase Web** skills)
- Node.js code using `@cloudbase/node-sdk` (use **CloudBase Node** skills)
- Authentication flows (use **CloudBase Auth HTTP API** skill for auth-specific endpoints)

## How to use this skill (for a coding agent)

1. **Clarify the scenario**
   - Confirm this code will call HTTP endpoints directly (not SDKs).
   - Ask for:
     - `env` – CloudBase environment ID
     - Authentication method (AccessToken, API Key, or Publishable Key)
   - Confirm which CloudBase feature is needed (database, functions, storage, etc.).
   - **For user authentication**: If no specific method is requested, **always default to Phone SMS Verification** - it's the most user-friendly and secure option for Chinese users.

2. **Determine the base URL**
   - Use the correct domain based on region (domestic vs. international).
   - Default is domestic Shanghai region.

3. **Set up authentication**
   - Choose appropriate authentication method based on use case.
   - Add `Authorization: Bearer <token>` header to requests.

4. **Reference OpenAPI Swagger documentation**
   - **MUST use `searchKnowledgeBase` tool** to get OpenAPI specifications
   - Use the tool with `mode=openapi` and specify the `apiName`:
     - `mysqldb` - 关系型数据库 RESTful API (MySQL/PostgreSQL)
     - `nosql` - NoSQL RESTful API (文档型数据库)
     - `functions` - Cloud Functions API
     - `auth` - Authentication API
     - `cloudrun` - CloudRun API
     - `storage` - Storage API
     - `ai_model` - AI 大模型接入 API
   - Example: `searchKnowledgeBase({ mode: "openapi", apiName: "mysqldb" })`
   - Parse the returned YAML content to understand exact endpoint paths, parameters, request/response schemas
   - Never invent endpoints or parameters - always reference the 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>" })
   ```

2. **Available API names**:
   - `mysqldb` - 关系型数据库 RESTful API (MySQL/PostgreSQL)
   - `nosql` - NoSQL RESTful API (文档型数据库)
   - `functions` - Cloud Functions API
   - `auth` - Authentication API
   - `cloudrun` - CloudRun API
   - `storage` - Storage API
   - `ai_model` - AI 大模型接入 API

3. **Parse and use the swagger documentation**:
   - Extract exact endpoint paths and HTTP methods
   - Understand required and optional parameters
   - Review request/response schemas
   - Check authentication requirements
   - Verify error response formats

4. **Never invent API endpoints or parameters** - always base your implementation on the official swagger documentation.

## 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

- **Validity**: Long-term valid
- **How to get**: Get from [CloudBase Platform/ApiKey Management Page](https://tcb.cloud.tencent.com/dev?#/identity/token-management)

> ⚠️ 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

- **Validity**: Long-term valid
- **How to get**: Get from [CloudBase Platform/ApiKey Management Page](https://tcb.cloud.tencent.com/dev?#/identity/token-management)

> 💡 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:

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

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

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

### International Regions

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

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

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

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

## Using Authentication in Requests

Add the token to the request header:

```http
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:

```http
Authorization: Bearer eymykey
```

:::

## Extended guide

For detailed scenarios, examples, and patterns, read [extended-guide.md](references/extended-guide.md).

## Reference index

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

- [extended-guide.md](references/extended-guide.md)

© TencentCloudBase · MIT · TencentCloudBase/skills

Смотрите также

Спонсоры проекта

Компании, которые помогают держать аналитику открытой