Ir para o conteúdo

Esta página está disponível em inglês. Sua preferência por português foi mantida para as páginas traduzidas.

Agent API & Grid / Developers

Build your first agent.
Start with one bounded task.

Request Agent API access, confirm an enabled agent and run a synthetic task with an explicit budget. Grid model API examples are available below.

Agent API and Grid access are by invitation. Your account determines enabled services and effective rates.

Agent API / First run

Delegate, inspect, then review.

Use the API origin, bearer key and enabled agent ID confirmed during onboarding. Confirm its tools and approval policy before sending a request. The example uses synthetic input and an illustrative budget.

  1. Set FORWARD_AGENT_BASE to the supplied origin, without a trailing slash. Keep FORWARD_AGENT_KEY in your server or local environment.
  2. Create first-agent.json with your enabled agent ID, a goal and budget as shown in the guide. Run from a private directory with umask 077.
  3. A successful delegation returns HTTP 202. Read run_id and status from run.json. Keep returned tokens private.
  4. Inspect GET /v1/agent/runs/{run_id} with the same authorization. Review completion, output and usage before increasing the scope.
Read the request body and approval guide Use the Grid model API
Delegate an agent run

curl --fail-with-body --silent --show-error \
  -X POST "${FORWARD_AGENT_BASE}/v1/agent/delegate" \
  -H "Authorization: Bearer ${FORWARD_AGENT_KEY}" \
  -H "Content-Type: application/json" \
  --data-binary @first-agent.json \
  --output run.json

Template only. Your account controls availability and effective rates. Sending a request can consume usage; a budget is not an estimate of the result's cost.

03 / First call

Choose your client.
Keep the same endpoint.

The examples read the key and model ID from your environment. They send one chat message and print the reply.

Before you run

Use an invited account, FORLEX_API_KEY and a chat-capable GRID_MODEL_ID from your enabled model list.

Set up access and model
API base
https://api.genai.forlex.cloud/v1
Request
POST /chat/completions

A successful request confirms access. Your evaluation determines whether a model fits the workflow.

Plan the evaluation

Install the SDK: python3 -m pip install openai. Save the example as first-call.py, then run python3 first-call.py.

first-call.py

import os
from openai import OpenAI

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

response = client.chat.completions.create(
    model=os.environ["GRID_MODEL_ID"],
    messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)

Access and setup

Set up your account and model.

Grid is by invitation. Keep your key in your local environment or server configuration, outside browser code and source control. The examples use placeholders.

01 / Access and key

Once invited, open the Console, go to Keys and create an API key.

Set your API key
Set your API key

export FORLEX_API_KEY="replace-with-your-key"
Open Grid Console

02 / Enabled model

Set FORLEX_API_KEY first. Choose a model that supports chat completions from your account list and use its exact ID.

List and select an enabled model

Replace both placeholders before running the first call.

List enabled models

curl https://api.genai.forlex.cloud/v1/models \
  -H "Authorization: Bearer ${FORLEX_API_KEY:?Set FORLEX_API_KEY first}"
Choose an enabled model

export GRID_MODEL_ID="replace-with-an-enabled-chat-model-id"
Compare the public catalog

04 / Prepare for production

Understand the response. Review the cost.

Add error handling, measure useful results and check consumption in the Console. Confirm data, deployment and operating requirements with the people who approve production.

Response troubleshooting
401 / 403
Check the key, invitation and account access. An enabled model list is specific to your account.
Access and keys
402 / 429
Review billing or request limits. Use backoff for rate limits; resolve billing before retrying.
Billing and limits
503
An idle serverless lane can be warming up. Follow Retry-After when present and use bounded retries.
Errors and cold start

Take the next step with your team.

Add detection

Scope OpenDetector AI-text review or prompt protection, with a separate detection contract and an operating policy.

Plan detection access

Connect your coding tool

Prepare a tool-specific configuration, then evaluate a pinned model on bounded coding tasks with your team.

Prepare a Connect setup

Adapt a model

Define the task, data readiness and evaluation before choosing a checkpoint or training method.

Explore training

Deliver a workflow

Bring the process and integrations. We scope the evaluation and implementation with your team.

Explore Projects

Solicitar acesso

O acesso às APIs de agentes e do Grid é por convite. Os serviços habilitados e os termos são confirmados nos primeiros passos.

Os rascunhos permanecem nesta visita do navegador. Atualizar a página os apaga.

Tratado conforme nosso Aviso de Privacidade e Proteção de Dados (GDPR, LGPD e CCPA). Nenhum dado pessoal é vendido ou compartilhado.

Fale conosco

Conte quem você é e o que precisa analisar.

Os rascunhos permanecem nesta visita do navegador. Atualizar a página os apaga.

Cada assunto mantém seus requisitos durante esta visita. Alterar o assunto preserva seus dados de contato.

Tratado conforme nosso Aviso de Privacidade e Proteção de Dados (GDPR, LGPD e CCPA). Nenhum dado pessoal é vendido ou compartilhado.

[CONTROLES DE PRIVACIDADE E TELEMETRIA]

Preferências de proteção de dados e telemetria

A Forward Intelligence (operada internacionalmente pela Forlex, LLC e, no Brasil, pela Forlex Ltda) respeita seus direitos nos termos do GDPR da União Europeia e do Reino Unido, da LGPD brasileira (Lei nº 13.709/2018) e da CCPA/CPRA da Califórnia.

Armazenamento estritamente necessárioSempre ativo

Armazena o tema de cores (grid-theme), o estado de navegação da documentação e sua preferência de privacidade (fwdi_privacy_consent_v1) localmente no navegador. Não são definidos cookies de terceiros nem rastreadores entre sites.

O seletor de idioma armazena apenas sua preferência em um cookie próprio (fwdi-language), por até um ano. Isso não habilita análises opcionais.

Análise de navegação e funil com dados reduzidosDisabled

Coleta visualizações agregadas de páginas em rotas de marketing permitidas e eventos gerais do funil comercial por meio de @vercel/analytics. Parâmetros de consulta, caminhos dinâmicos e dados pessoais são removidos no navegador antes do envio.

Ler o aviso completo de GDPR / LGPD / CCPA