快速开始
clawfeeder.ai 兼容 OpenAI 和 Anthropic SDK,只需替换 base_url 和 api_key 即可接入全部模型(含 GPT-5.x、Claude 4.5/4.6/4.7、Gemini、Qwen3.6、DeepSeek V4、GPT Image 2 等)。格式、参数、响应结构完全一致。
https://api.clawfeeder.ai/v1 和 https://clawfeeder.ai/v1 指向同一后端。Anthropic SDK 用裸 host(https://api.clawfeeder.ai), SDK 自动拼 /v1/messages。Base URL
https://api.clawfeeder.ai/v1API Key 格式
cf-sk-xxxxxxxxxxxxxx获取 API Key
按照以下步骤获取您的 API Key,全程约 2 分钟。
- 1注册账号 — 使用邮箱完成注册
- 2完成手机验证 — 验证手机号激活账户
- 3在 Dashboard 复制 API Key — 在 Dashboard > API Keys 页面生成并复制
Python 示例
安装 openai 库(pip install openai),然后运行以下代码。
from openai import OpenAI client = OpenAI( api_key="cf-sk-your-key-here", base_url="https://api.clawfeeder.ai/v1" ) response = client.chat.completions.create( model="claude-sonnet-4-6", messages=[{"role": "user", "content": "Hello!"}] ) print(response.choices[0].message.content)
Node.js / TypeScript 示例
安装 openai 包(npm install openai),然后使用以下代码。
import OpenAI from "openai"; const client = new OpenAI({ apiKey: "cf-sk-your-key-here", baseURL: "https://api.clawfeeder.ai/v1", }); const response = await client.chat.completions.create({ model: "claude-sonnet-4-6", messages: [{ role: "user", content: "Hello!" }], }); console.log(response.choices[0].message.content);
curl 示例
直接使用 curl 发送请求,无需任何 SDK。
curl https://api.clawfeeder.ai/v1/chat/completions \ -H "Authorization: Bearer cf-sk-your-key-here" \ -H "Content-Type: application/json" \ -d '{ "model": "DeepSeek-V3.2", "messages": [{"role": "user", "content": "Hello!"}] }'
图像生成
POST /v1/images/generations(文生图)和 /v1/images/edits(图像编辑,multipart 上传图片)兼容 OpenAI 协议。具体可用图像模型与单次扣减积分见下方模型列表。
from openai import OpenAI import base64 client = OpenAI( base_url="https://api.clawfeeder.ai/v1", api_key="cf-sk-your-key-here", ) # Text-to-image generation resp = client.images.generate( model="gpt-image-2", prompt="A red apple on a white table, studio lighting", size="1024x1024", quality="low", # low / medium / high — affects credits n=1, ) # Save the result (clawfeeder returns base64 by default) img_bytes = base64.b64decode(resp.data[0].b64_json) with open("apple.png", "wb") as f: f.write(img_bytes)
curl https://api.clawfeeder.ai/v1/images/generations \ -H "Authorization: Bearer cf-sk-your-key-here" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-image-2", "prompt": "A red apple on a white table", "size": "1024x1024", "quality": "low", "n": 1 }'
curl https://api.clawfeeder.ai/v1/images/edits \ -H "Authorization: Bearer cf-sk-your-key-here" \ -F "model=gpt-image-2" \ -F "image=@./input.png" \ -F "prompt=Make the apple green" \ -F "size=1024x1024" \ -F "n=1"
Nano Banana(Gemini 原生图像):Google 的 Gemini 图像模型走原生 /v1beta/models/{model}:generateContent 接口,分辨率通过 generationConfig.imageConfig.imageSize 指定(1024x1024 / 2048x2048 / 4096x4096 → 1K / 2K / 4K 档,影响扣减积分)。
# Nano Banana (Gemini native image generation) curl "https://api.clawfeeder.ai/v1beta/models/nano-banana-2:generateContent" \ -H "Authorization: Bearer cf-sk-your-key-here" \ -H "Content-Type: application/json" \ -d '{ "contents": [ { "parts": [ { "text": "A red apple on a white table, studio lighting" } ] } ], "generationConfig": { "imageConfig": { "imageSize": "2048x2048" } } }'
from google import genai from google.genai import types # Point the Gemini SDK at clawfeeder client = genai.Client( api_key="cf-sk-your-key-here", http_options=types.HttpOptions(base_url="https://api.clawfeeder.ai"), ) resp = client.models.generate_content( model="nano-banana-pro", # or nano-banana-2 contents="A red apple on a white table, studio lighting", config=types.GenerateContentConfig( image_config=types.ImageConfig(image_size="2048x2048"), # 1K / 2K / 4K → credits ), ) # Image parts are returned inline_data (base64) in resp.candidates[0].content.parts
视频生成
视频是异步两步流程:POST 提交立刻拿到 task_id,再 GET 轮询直到 SUCCEEDED 或 FAILED。提交时预扣保守积分,实际时长结算时多退少补,失败全额退款。具体可用视频模型与各时长档积分见下方模型列表。
# 1) Submit text-to-video — returns a task_id immediately curl https://api.clawfeeder.ai/v1/video/generations \ -H "Authorization: Bearer cf-sk-your-key-here" \ -H "Content-Type: application/json" \ -d '{ "model": "wan2.6-t2v", "input": { "prompt": "A small white cat walking on a wooden floor" }, "parameters": { "resolution": "720P", "duration": 5 } }' # → {"output":{"task_id":"<id>","task_status":"PENDING"}} # wan2.6 image-to-video: same endpoint, model=wan2.6-i2v, add input.img_url curl https://api.clawfeeder.ai/v1/video/generations \ -H "Authorization: Bearer cf-sk-your-key-here" \ -H "Content-Type: application/json" \ -d '{ "model": "wan2.6-i2v", "input": { "prompt": "the cat begins to run", "img_url": "https://example.com/cat.png" }, "parameters": {"resolution": "720P", "duration": 5} }' # HappyHorse 1.0 i2v / r2v: use input.media: [{"url": "..."}] (array form) curl https://api.clawfeeder.ai/v1/video/generations \ -H "Authorization: Bearer cf-sk-your-key-here" \ -H "Content-Type: application/json" \ -d '{ "model": "happyhorse-1.0-i2v", "input": { "prompt": "camera slowly zooms in", "media": [{"url": "https://example.com/photo.jpg"}] }, "parameters": {"resolution": "720P", "duration": 5} }' # HappyHorse 1.0 r2v (reference-to-video, subject/style transfer) curl https://api.clawfeeder.ai/v1/video/generations \ -H "Authorization: Bearer cf-sk-your-key-here" \ -H "Content-Type: application/json" \ -d '{ "model": "happyhorse-1.0-r2v", "input": { "prompt": "the subject dances gracefully", "media": [{"url": "https://example.com/reference.jpg"}] }, "parameters": {"resolution": "720P", "duration": 5} }'
# 2) Poll status — returns SUCCEEDED (with video URL) or FAILED curl https://api.clawfeeder.ai/v1/video/generations/<task_id> \ -H "Authorization: Bearer cf-sk-your-key-here" # PENDING / RUNNING → keep polling every ~15s # SUCCEEDED → output.video_url / output.video_duration # FAILED → output.message + full refund (you are NOT charged)
import time, requests BASE = "https://api.clawfeeder.ai" KEY = "cf-sk-your-key-here" # Submit (Aliyun-style nested body — input/parameters) r = requests.post( f"{BASE}/v1/video/generations", headers={"Authorization": f"Bearer {KEY}", "Content-Type": "application/json"}, json={ "model": "wan2.6-t2v", "input": {"prompt": "A small white cat walking on a wooden floor"}, "parameters": {"resolution": "720P", "duration": 5}, }, ) task_id = r.json()["output"]["task_id"] print("task:", task_id) # Poll until terminal — generation takes ~1-3 min for 5s clips while True: q = requests.get( f"{BASE}/v1/video/generations/{task_id}", headers={"Authorization": f"Bearer {KEY}"}, ).json() status = q["output"]["task_status"] print("status:", status) if status in ("SUCCEEDED", "FAILED"): print(q) break time.sleep(15)
提交后建议每 15 秒轮询一次,典型生成 1-3 分钟。
支持的模型
全部启用的模型(按类别分组)。直接在请求 body 的 model 字段填入模型名即可,无需其他配置。Credits 列为单次调用的最低档积分;长上下文 / 高分辨率 / 长视频会按 tier 升档,详见模型表后的备注。
价格、阶梯档位完整对照见 定价 → 模型表; 扣费如何计算见 计费机制。
| 模型 | 提供商 | Credits | 特点 |
|---|---|---|---|
查看 定价页 了解完整模型列表和积分消耗。
Auto 智能路由
把 model 字段设为 "auto",clawfeeder 会按 prompt 内容自动挑模型,无需自己挑型号。代码 → Opus,翻译/闲聊 → Haiku/Flash,普通问答 → 平衡档。响应头会回写实际使用的模型 ID,方便记账与排查。
curl https://api.clawfeeder.ai/v1/chat/completions \ -H "Authorization: Bearer cf-sk-..." \ -H "Content-Type: application/json" \ -d '{ "model": "auto", "messages": [ {"role": "user", "content": "Write a Python fibonacci function"} ] }' # Response headers expose the routing decision: # X-Clawfeeder-Auto-Category: code # X-Clawfeeder-Auto-Quality: best # X-Clawfeeder-Model: claude-opus-4-7
分类规则
| 类别 | 触发信号 | 档位 | 典型模型 |
|---|---|---|---|
| code | 代码/报错/接口/`backtick fences`、function、class、API… | best | claude-opus-4-7 / gpt-5.3-codex |
| math | 求解 / 方程 / 矩阵 / ∑ ∫ √ π 等符号 | best | claude-opus-4-7 |
| reason | 为什么 / 推理 / 分析 / 架构 / 权衡 | best | claude-opus-4-7 |
| long | 输入 > 4000 字符 | best | gemini-3.1-pro-preview |
| vision | 消息含 image_url / image 部分 | best | claude-opus-4-7 / gpt-5.4 |
| creative | 写一首诗 / 文案 / 起名 / brainstorm / tagline | balanced | gpt-5.2 / claude-sonnet-4-6 |
| translate | 翻译 / translate / 译成英文 | fast | gemini-3.1-flash-lite |
| summarize | 摘要 / 总结 / 要点 / tl;dr / outline | fast | claude-haiku-4-5 |
| chat | 你好 / hi / hello / 谢谢 | fast | gemini-3.1-flash-lite |
| general | 其他 | balanced | claude-haiku-4-5 / gpt-5.2 |
手动指定档位
传可选字段 quality: "fast" | "balanced" | "best" 跳过关键词分析,直接落到对应档。trial 用户超档会被退档到允许范围;余额不足时也会自动降档。
{ "model": "auto", "quality": "fast", "messages": [{"role": "user", "content": "..."}] }
第三方集成
用熟悉的工具,后端走 clawfeeder。Claude Code、Cursor、Cline、Aider 以及 OpenAI / Anthropic / LangChain SDK 都已验证可用。点卡片查看详细配置步骤。
Claude Code
Anthropic 官方 CLI,接到 clawfeeder.ai
Cursor
AI-first IDE,通过 OpenAI 兼容端点接 clawfeeder
Cline
VS Code 编码 agent(原 Claude Dev),配置 clawfeeder
OpenCode
开源终端编码 agent — provider 中立,可指向任意端点
Aider
结对编程 CLI,git 感知的代码编辑,配置 clawfeeder
OpenAI SDK
OpenAI 官方 Python / TypeScript SDK 接入 clawfeeder
Anthropic SDK
Anthropic 官方 Python / TypeScript SDK 接入 clawfeeder
LangChain
ChatOpenAI / ChatAnthropic 把 base URL 指向 clawfeeder
错误处理
clawfeeder.ai 返回标准 HTTP 状态码,与 OpenAI API 保持一致。
| 状态码 | 含义 |
|---|---|
| 401 | API Key 无效或过期 |
| 429 | 请求过于频繁,请降低频率 |
| 402 | 积分不足,请充值 |
| 500 | 上游模型服务异常,请重试 |
立即试用 clawfeeder.ai
7 天免费试用 · 300 积分 · 无需信用卡