xHalo LLM API Access

支持多种AI模型API的统一接入服务

支持的API服务

OpenAI Gemini Groq Claude Cohere xAI Mistral GithubAI

部署区域

Seoul, South Korea(ICN1)

OpenAI API

OpenAI API支持访问 GPT 模型。只需将原有请求中的域名改为我们的域名即可。

基础URL

${base_url}/openai/v1/

示例代码

curl ${base_url}/openai/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -d '{
    "model": "gpt-4o-2024-08-06",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Google Gemini API

支持访问Google的 Gemini 模型。使用方式与原生API完全一致。

基础URL

${base_url}/gemini/v1beta/
curl ${base_url}/gemini/v1beta/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $GEMINI_API_KEY" \
  -d '{
    "model": "gemini-exp-1114",
    "messages": [
        {"role": "user", "content": "Explain to me how AI works"}
    ]
  }'

Anthropic Claude API

支持访问 Claude 系列模型。

基础URL

${base_url}/claude/v1/
curl ${base_url}/claude/v1/messages \
  -H "Content-Type: application/json" \
  -H "x-api-key: $ANTHROPIC_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -d '{
    "model": "claude-3-5-sonnet-20241022",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Groq API

Groq 支持 OpenAI 格式的请求,提供更快的推理速度。

基础URL

${base_url}/groq/openai/v1/
curl ${base_url}/groq/openai/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $GROQ_API_KEY" \
  -d '{
    "model": "llama3-8b-8192",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Cohere API

支持 Cohere 的各种模型和API端点。

基础URL

${base_url}/cohere/v2/
curl ${base_url}/cohere/v2/chat \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $COHERE_API_KEY" \
  -d '{
    "model": "command-r-plus-08-2024",
    "messages": [{"role": "user", "content": "Hello!"}],
    "stream": true
  }'

xAI (Grok) API

支持 xAI 的 Grok 模型。

基础URL

${base_url}/xai/v1/
curl ${base_url}/xai/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $XAI_API_KEY" \
  -d '{
    "model": "grok-beta",
    "messages": [
          {
            "role": "system",
            "content": "You are Grok, a chatbot inspired by the Hitchhikers Guide to the Galaxy."
          },
          {
            "role": "user",
            "content": "What is the meaning of life, the universe, and everything?"
          }
        ],
    "stream": true,
    "temperature":0
  }'

Mistral API

支持 Mistral 的各种模型。

基础URL

${base_url}/mistral/v1/
curl ${base_url}/mistral/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $MISTRAL_API_KEY" \
  -d '{
    "model": "mistral-small-latest",
    "messages": [{"role": "user", "content": "Hello!"}],
    "stream": true
  }'

Github API

支持 Github AI 的各种模型。

基础URL

${base_url}/github/v1/
curl ${base_url}/github/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $GITHUB_API_KEY" \
  -d '{
    "model": "gpt-4o",
    "messages": [{"role": "user", "content": "Hello!"}],
    "stream": true
  }'