Add detection
Scope OpenDetector AI-text review or prompt protection, with a separate detection contract and an operating policy.
Plan detection accessEsta 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
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
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.
FORWARD_AGENT_BASE to the supplied origin, without a trailing slash. Keep FORWARD_AGENT_KEY in your server or local environment.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.run_id and status from run.json. Keep returned tokens private.GET /v1/agent/runs/{run_id} with the same authorization. Review completion, output and usage before increasing the scope.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.jsonTemplate 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
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.
A successful request confirms access. Your evaluation determines whether a model fits the workflow.
Plan the evaluationInstall the SDK: python3 -m pip install openai. Save the example as first-call.py, then run python3 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
Grid is by invitation. Keep your key in your local environment or server configuration, outside browser code and source control. The examples use placeholders.
Once invited, open the Console, go to Keys and create an API key.
export FORLEX_API_KEY="replace-with-your-key"Set FORLEX_API_KEY first. Choose a model that supports chat completions from your account list and use its exact ID.
Replace both placeholders before running the first call.
curl https://api.genai.forlex.cloud/v1/models \
-H "Authorization: Bearer ${FORLEX_API_KEY:?Set FORLEX_API_KEY first}"export GRID_MODEL_ID="replace-with-an-enabled-chat-model-id"04 / Prepare for production
Add error handling, measure useful results and check consumption in the Console. Confirm data, deployment and operating requirements with the people who approve production.
Scope OpenDetector AI-text review or prompt protection, with a separate detection contract and an operating policy.
Plan detection accessPrepare a tool-specific configuration, then evaluate a pinned model on bounded coding tasks with your team.
Prepare a Connect setupDefine the task, data readiness and evaluation before choosing a checkpoint or training method.
Explore trainingBring the process and integrations. We scope the evaluation and implementation with your team.
Explore Projects