跳至正文

本页面仅提供英文版本。在已翻译的页面上将保留您的中文语言偏好。

OpenAI compatibility

Grid speaks the OpenAI protocol so your existing client works. This page says what is covered today, so you can check before you depend on it.

Compatibility is a floor, not a feature. It is here so that moving to Grid costs you two lines rather than a rewrite, and so that leaving would cost you the same. What Grid asks you to evaluate is portability, routing and the meter, not the shape of the request body.

Using the OpenAI SDKs#

Set the base URL and use the client you already have. Authentication is a bearer token in the standard Authorization header, so nothing about the auth flow changes.

Python

import os
import openai

client = openai.OpenAI(
    base_url="https://api.genai.forlex.cloud/v1",
    api_key=os.environ["FORLEX_API_KEY"],
)
TypeScript

import OpenAI from 'openai'

const client = new OpenAI({
  baseURL: 'https://api.genai.forlex.cloud/v1',
  apiKey: process.env.FORLEX_API_KEY,
})

If you prefer environment variables, OPENAI_BASE_URL and OPENAI_API_KEY work as they normally do, which lets you point an existing application at Grid without touching its code at all.

Endpoints#

EndpointStatus
POST /v1/chat/completionsSupported
GET /v1/modelsSupported
GET /v1/models/{model}Not available yet
POST /v1/completionsNot confirmed
POST /v1/embeddingsNot confirmed
POST /v1/batchesNot available. Grid Batch is a separate surface, see Run modes

GET /v1/models returns the OpenAI list envelope, so SDK helpers that enumerate models work unchanged:

JSON

{
  "object": "list",
  "data": [
    { "id": "livia-e1-flash", "object": "model", "created": 1700000000, "owned_by": "Forlex" },
    { "id": "livia-e1-mini", "object": "model", "created": 1700000000, "owned_by": "Forlex" }
  ]
}

The list is the authority on what you can call. Prefer reading it at runtime over hardcoding a model id, both because the catalog is curated and because it is the one source that cannot be out of date.

Parameters on chat completions#

ParameterStatus
modelSupported. A catalog id, or grid-auto for Smart Router
messagesSupported
streamSupported
tools, tool_choiceSupported
logprobs, top_logprobsNot available yet

Parameters not listed here are not documented as working. That is a statement about what we have verified, not a statement that they fail. If you need one confirmed before you build on it, ask and we will answer specifically rather than generally.

Where Grid differs#

Two differences are worth knowing before you write error handling.

Authentication failures return a plain text body. A request with a missing or invalid key answers 401 with content-type: text/plain, not the JSON {"error": {...}} envelope the OpenAI SDKs expect. The SDKs will surface the status code correctly but may not parse it into a typed error object. If your code branches on a parsed error body, handle the status code as well.

Serverless can answer 503 on a cold lane. The OpenAI API does not scale to zero, so this is a state your existing retry logic may not cover. See Errors and cold start.

Response headers#

Grid adds x-grid-routed-model, naming the model that produced the response. It is present whether or not you used routing, which makes it the single thing to log if you want to be able to reconstruct an answer later.

申请访问权限

Agent API 与 Grid 访问权限均实行邀请制。具体启用的服务与条款将在入驻引导期间确认。

草稿仅在本次浏览器访问期间保留。刷新页面将清空草稿。

依据我们的 隐私与数据保护声明 (GDPR、LGPD 与 CCPA)进行处理。绝不出售或共享任何个人数据。

联系我们

请告知您的基本信息和需要评估的需求内容。

草稿仅在本次浏览器访问期间保留。刷新页面将清空草稿。

在本次访问期间,每个主题都会保留各自的需求内容。切换主题不会丢失您的联系方式。

依据我们的 隐私与数据保护声明 (GDPR、LGPD 与 CCPA)进行处理。绝不出售或共享任何个人数据。

[隐私与遥测控制]

数据保护与遥测偏好设置

Forward Intelligence (国际业务由 Forlex, LLC 运营,巴西业务由 Forlex Ltda运营) 尊重您在欧盟/英国 GDPR、巴西 LGPD(Lei nº 13.709/2018)以及加利福尼亚州 CCPA/CPRA 下享有的权利。

严格必要的存储始终启用

在您的浏览器本地存储颜色主题 (grid-theme)、文档导航状态以及您的隐私偏好设置 (fwdi_privacy_consent_v1)。不会设置任何第三方 Cookie 或跨站追踪器。

语言选择器仅将您的语言偏好保存在第一方 Cookie (fwdi-language) 中,有效期最长为一年。这不会启用任何可选的分析功能。

脱敏路由与漏斗分析已禁用

收集列入白名单的营销路由上的汇总页面浏览量及粗粒度商业漏斗事件,采集工具为 @vercel/analytics。查询字符串、动态路径和个人数据在发送前均会在客户端进行脱敏处理。

阅读完整的 GDPR / LGPD / CCPA 声明