Skip to main content

Connect your application

After the Quickstart, your gateway is connected and a test request works. This page connects your own application to the same gateway. Your application then sends its model requests to Verdictan instead of to the provider, and your policies and budgets apply to each request. The application never holds the provider key.

Before you start​

  • A connected gateway and an agent from the Quickstart.
  • An API token for the application. Create one in Administration → Credentials → API tokens in the Console. See Manage API tokens.
  • An application or client that can send OpenAI-compatible requests and lets you set the base URL.

1. Collect the three values​

Client settingValue
Base URLThe agent URL with /v1, for example https://<agent-host>/v1. Find the host on the agent page in Agents. On the computer that runs the gateway, you can also use http://127.0.0.1:41002/v1.
API keyThe API token of the application. It is not your provider key.
ModelA model ID that model discovery returns for this agent.

Put the values in environment variables, not in your source code:

Bash
export VERDICTAN_BASE_URL="https://<agent-host>/v1"
export VERDICTAN_CLIENT_TOKEN="<api-token>"

2. Check the values​

Send an authenticated model discovery request:

Bash
curl -fsS "${VERDICTAN_BASE_URL}/models" \
  -H "Authorization: Bearer ${VERDICTAN_CLIENT_TOKEN}"

The data array has one object for each model that the agent can use. Use one of the id values as the model of your application. A 401 response shows that the token is incorrect, expired, or revoked.

3. Configure your application​

Set the base URL, the API key, and the model in your client. Use the guide for your language, framework, or tool:

You useGuide
Node.js, Python, Java, or .NETNode.js, Python, Java & Spring Boot, .NET
An agent frameworkGoogle ADK, Instructor, CopilotKit, Gradio
An editor or coding agentIDE integration overview
A chat applicationOpen WebUI
A different OpenAI-compatible clientConnect an OpenAI-compatible client

4. Verify​

  1. Send one request from your application.
  2. In the Console, open History and find the request, when capture is on. You can also read the decision event with verdictan events tail --since 10m.
  3. Check that the request uses the agent, the API token, and the model that you set.

A request that a policy blocks returns an error with a reason code. See Investigate a blocked request.

Troubleshooting​

SymptomCheck
401 from the gatewayThe API token value, its expiry, and that it is not revoked.
404 or a connection errorThe base URL ends in /v1 and uses the agent host.
The model is rejectedThe model is one of the id values from model discovery.
The request does not appear in HistoryHistory capture is on for the configuration. The decision event shows each request.

Next steps​