Skip to main content
This quickstart uses the agent endpoint because it is the fastest path to coverage. If you need to gate non-LLM actions too, continue with the Xenovia Python SDK after this.

1. Collect the values you need

From the Xenovia platform:
  1. Create an agent and note the agent ID.
  2. Generate an API key (xe_...) for that agent.
  3. Activate the agent. While it is a draft, the runtime rejects its keys with 401.
Set them as environment variables:

2. Point your client at Xenovia

3. Send your first governed request

The request now flows through Xenovia for authentication, provider routing, session handling, policy checks, and trace recording.

4. Add a stable session ID

Group related calls into a session so multi-turn conversations appear together in Sessions.
The session ID must be a valid UUID. A malformed value is rejected with 400.

5. Confirm the trace exists

After the request completes, check the platform and confirm:
  • A trace exists for the request
  • The trace shows the expected model and agent
  • The response includes X-Xenovia-Session-Id and X-Xenovia-Trace-Id

6. Attach a first policy

Start with one policy that proves enforcement is working. Set it to Enforce (new policies start in Monitor) and enable it. This example blocks a destructive tool name:
A policy returns a single decision object; block yields a 403. Attach request-stage and response-stage policies independently. See Policies and Enforcement for the full contract.

7. Handle a policy block

When a request is blocked, the runtime returns 403 Forbidden. The OpenAI SDK raises this as PermissionDeniedError.

8. Add trace metadata

Tag traces with business context so they stay useful as traffic grows.

What to do next

After this first pass, move on to:
If your real workflow performs risky actions after the model call, add the Xenovia Python SDK so those actions are governed too.