Developers / Choose your entry point

Build around
the work.

Start with model access, agent workflows or knowledge. Choose the integration path that fits your application.

Explore Swfte on GitHub ↗

In short:用于构建 AI 应用的 OpenAI 兼容网关。使用官方 OpenAI SDK 或普通 HTTP 请求,配合您的 Swfte API 密钥即可。

INTEGRATION MAP / ILLUSTRATIVE
application → model access → response

Model access

Connect your application to model access. Start by reviewing routing, authentication and usage requirements.

Explore Connect

Follow the published reference.

Read the SDK examples and integration guidance alongside the product you intend to use.

Open the developer reference

Before your first integration

Agree the credential boundary, test inputs, failure handling and the usage you need to observe.

Discuss an integration
在线试用

交互式 API 演练场

使用实时代码示例和即时结果测试 API 调用。

agents.run()models.list()chat.complete()embeddings.create()workflows.execute()knowledge.query()analytics.track()files.upload()agents.run()models.list()chat.complete()embeddings.create()workflows.execute()knowledge.query()analytics.track()files.upload()
curl https://api.swfte.com/agents/v2/gateway/chat/completions \
  -H "Authorization: Bearer $SWFTE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai:gpt-4o-mini",
    "messages": [
      { "role": "user", "content": "Say hello in five words." }
    ]
  }'

您的引导式集成路径

通过我们的分步集成指南在几分钟内启动并运行。

export SWFTE_API_KEY="sk-swfte-..."
步骤 1

Create an API key

Open the Connect console, create an API key and keep it in an environment variable.

# pip install openai
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.swfte.com/agents/v2/gateway",
    api_key=os.environ["SWFTE_API_KEY"],
)
步骤 2

Point the OpenAI SDK at Swfte

The gateway is OpenAI-compatible. Install the official openai package and set the base URL.

response = client.chat.completions.create(
    model="openai:gpt-4o-mini",
    messages=[{"role": "user", "content": "Hello, world!"}],
)
print(response.choices[0].message.content)
步骤 3

Make your first request

Use a mini model on the free plan. Any OpenAI-compatible client or plain curl works the same way.

常见问题

目前还没有 Swfte 专属 SDK。网关与 OpenAI 兼容,只需将基础 URL 指向 Swfte 网关,即可使用官方 OpenAI SDK(Python、TypeScript 等)或任何 HTTP 客户端。

使用存储在环境变量中或直接传递给 SDK 的 API 密钥。我们支持用于企业 SSO 集成的 OAuth2,并提供安全的密钥轮换。

免费层:每分钟 100 个请求。专业版:每分钟 1,000 个请求。企业版:具有专用容量和突发处理的自定义限制。

SDK 提供了带有详细消息的类型化错误类。所有错误都包含用于调试和支持的请求 ID。我们还提供带有指数退避的自动重试。

是的!所有 SDK 都支持服务器发送事件 (SSE) 以进行实时流式传输。您可以在生成令牌时接收它们以实现响应式 UI。

准备好开始构建了吗?

获取您的 API 密钥并在几分钟内开始构建。

Deploy a model with Swfte Connect

One gateway, every provider, per-token cost visibility. Swap models without touching your code.