# 快速开始 — 3 分钟接入 100+ 大模型 Source: https://ofox.io/zh/docs/develop 一个 API Key 调用 GPT、Claude、Gemini、DeepSeek 等 100+ 大模型。请先选择使用方式。 ## 选择使用方式 - [在工具里使用(不写代码)](https://ofox.io/zh/docs/integrations) — 在 Cherry Studio、Claude Code、Codex、Chatbox 等工具中填写 API 地址和 Key 即可使用。 - [通过 API 接入(写代码)](https://ofox.io/zh/docs/develop#steps) — 兼容 OpenAI、Anthropic、Gemini 官方 SDK,只需修改 API 地址和 Key。 ## 三步接入 API ### 获取 API Key 登录 [OfoxAI 控制台](https://app.ofox.io),进入 **设置 → API Keys**,创建新密钥。Key 仅在创建时显示一次,请妥善保存。详见[API Key 获取与使用](https://ofox.io/zh/docs/develop/authentication)。 ### 填写 API 地址 按使用的 SDK 选择对应地址: - OpenAI 兼容: `https://api.ofox.io/v1` — 通用,推荐 - Anthropic 原生: `https://api.ofox.io/anthropic` - Gemini 原生: `https://api.ofox.io/gemini` ### 发送第一个请求 将 `<你的 OFOXAI_API_KEY>` 替换为第 1 步获得的 Key 后运行,收到模型回复即表示接入成功。 **cURL** ```bash filename="Terminal" curl https://api.ofox.io/v1/chat/completions \ -H "Authorization: Bearer <你的 OFOXAI_API_KEY>" \ -H "Content-Type: application/json" \ -d '{ "model": "openai/gpt-6.1-sol", "messages": [ {"role": "user", "content": "生命的意义是什么?"} ] }' ``` **Python** ```python filename="quickstart.py" from openai import OpenAI client = OpenAI( base_url="https://api.ofox.io/v1", api_key="<你的 OFOXAI_API_KEY>" ) response = client.chat.completions.create( model="openai/gpt-6.1-sol", messages=[{"role": "user", "content": "生命的意义是什么?"}] ) print(response.choices[0].message.content) ``` **TypeScript** ```typescript filename="quickstart.ts" import OpenAI from 'openai' const client = new OpenAI({ baseURL: 'https://api.ofox.io/v1', apiKey: '<你的 OFOXAI_API_KEY>' }) const response = await client.chat.completions.create({ model: 'openai/gpt-6.1-sol', messages: [{ role: 'user', content: '生命的意义是什么?' }] }) console.log(response.choices[0].message.content) ``` 使用 Anthropic 或 Gemini 官方 SDK,请参阅 [Anthropic Messages](https://ofox.io/zh/docs/api/anthropic/messages) 和 [Gemini Generate Content](https://ofox.io/zh/docs/api/gemini/generate-content)。 ## 按任务查找 - [在 Claude Code 中使用](https://ofox.io/zh/docs/integrations/claude-code) — 编程助手接入 OfoxAI,含环境变量配置。 - [在 Cherry Studio 中对话](https://ofox.io/zh/docs/integrations/cherry-studio) — 聊天客户端添加 OfoxAI 供应商。 - [生成与编辑图片](https://ofox.io/zh/docs/develop/models/gpt-image) — GPT Image 文生图、改图、局部重绘。 - [生成视频](https://ofox.io/zh/docs/api/videos) — 异步任务:创建、查询、回调。 - [迁移现有 OpenAI 项目](https://ofox.io/zh/docs/integrations/openai-sdk) — 只需修改 base_url 和 API Key。 - [降低调用成本](https://ofox.io/zh/docs/develop/advanced/prompt-caching) — 提示缓存与供应商路由。 - [处理报错](https://ofox.io/zh/docs/develop/guides/error-handling) — 常见错误码、重试与排查方法。 - [查看全部模型](https://ofox.io/zh/docs/develop/models) — 模型 ID、价格与上下文长度。 ## 更多资料 - [API Key 获取与使用](https://ofox.io/zh/docs/develop/authentication):三种协议分别怎么在请求里带上 Key - [计费说明](https://ofox.io/zh/docs/develop/observability/pricing)与[用量追踪](https://ofox.io/zh/docs/develop/observability/usage-tracking) - [安全与数据](https://ofox.io/zh/docs/develop/security) - [API 参考](https://ofox.io/zh/docs/api):全部接口的参数与返回值