API Documentation
Welcome to VibeCore OS API. Integrate our REST API into your applications.
Getting Started
Welcome to VibeCore OS API. Integrate our REST API into your applications.
- 11. Create an Account -Sign up for a VibeCore OS account to get started. You can start with our Free plan.
- 22. Generate an API Key -Go to your Dashboard and generate an API Key. Keep this key secure as it grants access to your account.
- 33. Make Your First Request -Use your API Key to authenticate requests to our API endpoints.
Authentication
All API requests must include your API Key in the Authorization header:
All API requests must include your API Key in the Authorization header:
HTTP Header
Authorization: Bearer YOUR_API_KEY⚠️ Error Handling
切勿在客户端代码(如浏览器 JavaScript)中暴露您的 API Key。 所有 API 调用应在您的服务器端进行,或确保采取适当的安全措施。
API Endpoints
VibeCore OS API Endpoints
POST
/api/v1/demoGenerate AI-powered content using our advanced models.
Request Body
{
"message": "string (optional)" // 自定义消息,默认为 "Hello from VibeCore OS"
}Response
{
"status": "success",
"data": {
"message": "VibeCore OS 核心业务引擎响应成功",
"echo": "您发送的消息",
"processedBy": "v1-demo-engine"
},
"meta": {
"userId": "user_cuid",
"userEmail": "user@example.com",
"userPlan": "pro",
"subscriptionStatus": "active",
"requestId": "uuid",
"timestamp": "2024-01-15T10:30:00.000Z"
}
}GET
/api/v1/demo健康检查端点。用于测试 API Key 和连接状态。
Code Examples
使用您喜欢的编程语言调用 VibeCore OS API
curl -X POST "https://vibecoreos.com/api/v1/demo" \
-H "Authorization: Bearer vibe_live_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"message": "Hello from my app"}'Error Handling
API 错误响应遵循统一的格式
当 API 请求失败时,服务器会返回包含错误详情的 JSON 响应。所有错误响应都包含status: "error"字段和详细的错误信息。
{
"status": "error",
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or revoked API Key"
},
"timestamp": "2024-01-15T10:30:00.000Z",
"requestId": "550e8400-e29b-41d4-a716-446655440000"
}400请求格式错误(如 JSON 解析失败)
401API Key 无效、缺失或已过期
403API Key 已被吊销
500服务器内部错误
CORS Support
VibeCore OS API 支持跨域资源共享 (CORS),允许从任何域名进行调用。 API 会自动处理 OPTIONS 预检请求,您无需在客户端进行额外配置即可从前端应用直接调用。
Access-Control-Allow-Origin: *Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONSAccess-Control-Allow-Headers: Content-Type, Authorization