跳转到主要内容

Documentation Index

Fetch the complete documentation index at: https://docs.omniakey.com/llms.txt

Use this file to discover all available pages before exploring further.

这个页面用 OpenAI 兼容接口演示第一条请求。如果你要配置 Claude Code、Cursor、Codex、Cline 或 aider,请看 工具与 SDK

第 1 步:创建 API key

API Keys dashboard 创建一把 key。所有 API 请求都使用:
Authorization: Bearer your-omniakey-api-key

第 2 步:安装 SDK

OmniaKey 不需要专用 SDK。OpenAI 官方 SDK 可以直接使用。
pip install openai

第 3 步:发送请求

把 base URL 设置为 https://api.omniakey.com/v1,模型 ID 从 支持模型 复制。
from openai import OpenAI

client = OpenAI(
    api_key="your-omniakey-api-key",
    base_url="https://api.omniakey.com/v1",
)

response = client.chat.completions.create(
    model="claude-opus-4-8",
    messages=[{"role": "user", "content": "Explain what a race condition is."}],
)

print(response.choices[0].message.content)

第 4 步:开启流式输出

stream = client.chat.completions.create(
    model="claude-opus-4-8",
    messages=[{"role": "user", "content": "Write a haiku about clean code."}],
    stream=True,
)

for chunk in stream:
    if chunk.choices[0].delta.content is not None:
        print(chunk.choices[0].delta.content, end="")

下一步

API 参考

查看三套协议和能力边界

工具接入

配置 Claude Code、Cursor、Codex、Cline、aider

支持模型

复制当前可用模型 ID