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 setting | Value |
|---|---|
| Base URL | The 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 key | The API token of the application. It is not your provider key. |
| Model | A model ID that model discovery returns for this agent. |
Put the values in environment variables, not in your source code:
export VERDICTAN_BASE_URL="https://<agent-host>/v1"
export VERDICTAN_CLIENT_TOKEN="<api-token>"2. Check the values
Send an authenticated model discovery request:
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 use | Guide |
|---|---|
| Node.js, Python, Java, or .NET | Node.js, Python, Java & Spring Boot, .NET |
| An agent framework | Google ADK, Instructor, CopilotKit, Gradio |
| An editor or coding agent | IDE integration overview |
| A chat application | Open WebUI |
| A different OpenAI-compatible client | Connect an OpenAI-compatible client |
4. Verify
- Send one request from your application.
- 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. - 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
| Symptom | Check |
|---|---|
401 from the gateway | The API token value, its expiry, and that it is not revoked. |
404 or a connection error | The base URL ends in /v1 and uses the agent host. |
| The model is rejected | The model is one of the id values from model discovery. |
| The request does not appear in History | History capture is on for the configuration. The decision event shows each request. |
Next steps
- Connect a model provider: add a second provider or a saved provider key.
- Policy configuration overview: control which requests go to the model.
- Usage and budgets: set a spending limit for the application.
- Install the gateway: install the gateway as a service for production.