Saltar al contenido

Esta página está disponible en inglés. Su preferencia por el español se mantiene en las páginas traducidas.

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.

Solicitar acceso

El acceso a la Agent API y a Grid es por invitación. Los servicios habilitados y las condiciones se confirman durante la incorporación.

Los borradores se conservan durante esta visita en el navegador. Al actualizar la página se borran.

Procesado conforme a nuestro Aviso de Privacidad y Protección de Datos (RGPD, LGPD y CCPA). No se venden ni comparten datos personales.

Hable con nosotros

Indíquenos quién es usted y qué necesita revisar.

Los borradores se conservan durante esta visita en el navegador. Al actualizar la página se borran.

Cada tema conserva sus propios requisitos durante esta visita. Cambiar de tema mantiene sus datos de contacto.

Procesado conforme a nuestro Aviso de Privacidad y Protección de Datos (RGPD, LGPD y CCPA). No se venden ni comparten datos personales.

[CONTROLES DE PRIVACIDAD Y TELEMETRÍA]

Preferencias de Protección de Datos y Telemetría

Forward Intelligence (operada internacionalmente por Forlex, LLC y en Brasil por Forlex Ltda) respeta sus derechos conforme al RGPD de la UE y el Reino Unido, la LGPD de Brasil (Ley n.º 13.709/2018) y la CCPA/CPRA de California.

Almacenamiento estrictamente necesarioSiempre activo

Almacena localmente en su navegador el tema de color (grid-theme), el estado de navegación de la documentación y su preferencia de privacidad (fwdi_privacy_consent_v1). No se instalan cookies de terceros ni rastreadores entre sitios.

El selector de idioma guarda únicamente su preferencia en una cookie propia (fwdi-language) durante un máximo de un año. Esto no activa la analítica opcional.

Analítica anonimizada de rutas y embudo comercialDeshabilitado

Recopila vistas de página agregadas en rutas de marketing autorizadas y eventos generales del embudo comercial mediante @vercel/analytics. Las cadenas de consulta, las rutas dinámicas y los datos personales se anonimizan en el cliente antes del envío.

Leer el aviso completo de RGPD / LGPD / CCPA