PromptLabHub
PromptLabHub
/

入门

概览身份验证速率限制与配额

API 端点

GET列出 PromptGET获取 PromptPOST提交 PromptGET列出分类

HTTP 错误代码

HTTP 错误代码

示例

示例

官方 SDK

官方 SDK
PromptLabHub
PromptLabHub
/

入门

概览身份验证速率限制与配额

API 端点

GET列出 PromptGET获取 PromptPOST提交 PromptGET列出分类

HTTP 错误代码

HTTP 错误代码

示例

示例

官方 SDK

官方 SDK

API 参考

PromptLabHub API 参考

以低延迟编程方式访问您保存的 prompt、运行搜索查询、按模型筛选并查询 prompt 分类。

获取 API 密钥API 更新日志

身份验证

所有 API 请求必须在 Authorization 标头中使用 Bearer token 进行身份验证。API 密钥可在 API 设置中管理。

Authorization 标头
Authorization: Bearer plh_live_your_key_here

速率限制与配额

速率限制根据您的计划层级按 API 密钥每日和每月应用。活跃请求返回标准速率限制标头。

订阅层级

订阅层级每日限制每月限制
免费1003,000
Pro1,00030,000
Enterprise10,000300,000

速率限制响应标头

标头描述
X-RateLimit-Limit每日允许的最大请求数。
X-RateLimit-Remaining当日剩余请求数。
X-RateLimit-Reset当前速率限制窗口重置的 UTC 时间(秒)。

API 端点

GET/api/v1/prompts

获取已发布 prompt 的分页列表,支持搜索关键词和分类筛选。

Query Parameters

字段类型必填描述
categorystring否按分类 slug 或名称筛选
searchstring否匹配标题、描述或内容的关键词
pagenumber否(1)分页偏移页码索引
limitnumber否(20)最大返回数量(1 - 50)
curl -X GET "https://promptlabhub.com/api/v1/prompts?category=photography&search=sunset" \
  -H "Authorization: Bearer plh_live_your_key_here"
JSON
{
  "data": [
    {
      "id": "triple-ice-cream-fantasy",
      "title": "Triple Ice Cream Fantasy",
      "category": "food-photography",
      "model": "Midjourney",
      "copyCount": 1420,
      "createdAt": "2025-05-10T00: 00: 00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 384
  }
}
GET/api/v1/prompts/:slug

通过 ID 获取特定 prompt 的详情。

查询参数

字段类型必填描述
slugstring是标识 prompt 的唯一 slug
cURL
curl -X GET "https://promptlabhub.com/api/v1/prompts/triple-ice-cream-fantasy" \
  -H "Authorization: Bearer plh_live_your_key_here"
JSON
{
  "id": "triple-ice-cream-fantasy",
  "title": "Triple Ice Cream Fantasy",
  "content": "\"resolution\": \"8K\", \"aspect_ratio\": \"3: 4\"...",
  "category": "food-photography",
  "model": "Midjourney",
  "difficulty": "Advanced",
  "copyCount": 1420,
  "createdAt": "2025-05-10T00: 00: 00Z"
}
POST/api/v1/prompts

动态提交 prompt 以供审批/审核。

请求体参数

字段类型必填描述
titlestring是prompt 创建标题
descriptionstring是选项的简短摘要/备注
contentstring是完整的 AI prompt 文本表述
categorystring/number是分类 ID、名称或 slug
cURL
curl -X POST "https://promptlabhub.com/api/v1/prompts" \
  -H "Authorization: Bearer plh_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Neon Tokyo Street Night",
    "description": "Cinematic cyberpunk street scene",
    "content": "neon-lit alley, rain reflections, 8K...",
    "category": "photography"
  }'
JSON
{
  "data": {
    "id": "neon-tokyo-street-night",
    "status": "pending"
  }
}
GET/api/v1/categories

列出所有可用的 prompt 分类。

cURL
curl -X GET "https://promptlabhub.com/api/v1/categories" \
  -H "Authorization: Bearer plh_live_your_key_here"
JSON
{
  "data": [
    { "slug": "photography", "name": "Photo Prompts" },
    { "slug": "food-photography", "name": "Food Prompts" },
    { "slug": "video", "name": "Video Prompts" }
  ]
}

HTTP 错误代码

HTTP 状态代码字符串描述
400VALIDATION_FAILED请求体参数无效或缺失。
401UNAUTHORIZEDAPI 密钥标头缺失、不正确或 token 已被撤销。
404NOT_FOUND未找到请求的 prompt ID 或资源。
429RATE_LIMIT_EXCEEDED您的每日 API 密钥配额已用完。升级至 Pro/Enterprise 以获得更高限制。
500INTERNAL_SERVER_ERROR发生意外服务器错误。请稍后重试。

集成示例

JavaScript Fetch
"text-[#6b7280]">// JavaScript fetch example
"text-[#f97583]">const apiKey = 'plh_live_your_key_here'

"text-[#f97583]">async "text-[#f97583]">function fetchPrompts() {
  "text-[#f97583]">const response = "text-[#f97583]">await fetch('https:"text-[#6b7280]">//promptlabhub.com/api/v1/prompts?limit=5', {
    headers: {
      'Authorization': `Bearer ${apiKey}`
    }
  })
  "text-[#f97583]">const data = "text-[#f97583]">await response.json()
  "text-[#f97583]">console.log(data.data)
}

fetchPrompts()
Python Requests
"text-[#f97583]">class="text-[#6b7280]"># Python requests example
"text-[#f97583]">import requests

api_key = 'plh_live_your_key_here'
url = 'https://promptlabhub.com/api/v1/prompts'
headers = {'Authorization': f'Bearer {api_key}'}
params = {'limit': 5}

response = requests.get(url, headers=headers, params=params)
"text-[#f97583]">print(response.json())

官方 SDK

Node.js、Python 和 Go 的 SDK 即将推出。目前,您可以使用标准 HTTP 库或 curl 示例直接连接。

Node.js — Coming SoonPython — Coming SoonGo — Coming Soon

本页内容

  • Overview
  • Authentication
  • Rate Limits & Quotas
  • API Endpoints
  • List Prompts
  • Get Prompt
  • Submit Prompt
  • List Categories
  • HTTP Error Codes
  • Examples
  • Official SDKs