Start with one working model and one authorized caller. Then add the permissions your application needs. You do not need to configure every AI feature to make your first model call.
This guide describes the updated AI console. Use matching control-plane, runtime and CLI builds; a website guide does not upgrade an installed release. Workload identity remains a preview with the limits listed in its guide. Licensed features must also be explicitly enabled for the organization.
Choose your starting point
Section titled “Choose your starting point”| I want to… | Start here | Identity used |
|---|---|---|
| Call a model from my laptop | First model call | Your Tunnex user and model grants |
| Run a service without a person signing in | Connect an application | A workload instance |
| Manage an agent host and its private access | Enroll an AI agent | A managed agent with a human owner |
| Let an agent use selected MCP tools | Connect an MCP server | The managed runtime plus MCP policy |
| Reuse private destination permissions | Policy templates | An agent group |
| Approve short-lived private access | Temporary access | A named agent and an approved request |
User groups contain people. Agent groups contain managed machines. A model grant, a network rule and an MCP tool rule control different actions: creating one does not automatically create the others.
Make your first model call
Section titled “Make your first model call”1. Administrator: prepare a model
Section titled “1. Administrator: prepare a model”- Confirm that the installation has a healthy private AI engine and matching provider-testing services. Follow AI Gateway installation prerequisites.
- Open AI Gateway → Settings and enable AI access for this organization.
- Open LLM credentials → Add Credentials. Choose your provider, the exact deployed model name, its supported mode, endpoint and provider credential.
- Select Test Connect, then Create credentials after success. Testing makes an upstream request and may incur a charge; it does not grant access.
- Check Models & endpoints for the model and its applied state. To add another model with the same credentials, use Add Model → Existing Credentials.
- Under Users & Groups → Groups, add the intended people to a group.
- Under AI Gateway → Access, grant that group the exact model. Wait for the access configuration to be applied.
For Azure, use the deployment’s endpoint and deployment name, not just a catalog suggestion. See Azure endpoint examples. Provider credentials stay in the managed provider configuration; customers calling Tunnex do not need a copy of the Azure or other provider key.
2. User: verify in the browser
Section titled “2. User: verify in the browser”- Sign in and select the intended organization.
- Open AI Gateway → My models. Only your permitted models appear.
- For a chat model, select Call model, enter a short prompt and send it.
- Read the answer and token count. Expand Response details if you need the original response for troubleshooting.
- Copy the base URL, API model ID and, when needed, organization ID from the model’s connection details. Do not substitute the upstream model name for the gateway’s API model ID.
For other modes, use the operation-specific example shown for that model. A chat example cannot test an embedding, image, audio, rerank or video deployment.
3. Laptop: use the OpenAI SDK over VPN
Section titled “3. Laptop: use the OpenAI SDK over VPN”Your administrator must first configure the VPN AI ingress, private DNS/routing
and HTTPS for the control-plane hostname. Connect the Tunnex desktop client and
confirm a recent handshake. Signing in with tunnex login alone does not create
a VPN tunnel.
When your user has one organization membership, the configured VPN base URL
can be https://your-control-plane.example.com/ai/v1. With multiple
memberships, copy the organization-specific base URL displayed in My models:
https://your-control-plane.example.com/api/v1/organizations/<organization-id>/ai-gateway/inference/v1The UI supplies the ID: you do not need to look it up in a database. Use the URL for the selected organization even when several gateways exist. A gateway’s public IP is not a replacement for this HTTPS base URL.
Create an isolated Python environment:
mkdir tunnex-ai-democd tunnex-ai-demopython3 -m venv .venvsource .venv/bin/activatepython -m pip install openaiSave this as demo.py, replacing the two marked values with My models values:
from openai import OpenAI
client = OpenAI( base_url="https://your-control-plane.example.com/ai/v1", # Copy base URL api_key="unused", # SDK requires a value; configured VPN identity authorizes it timeout=60.0,)response = client.chat.completions.create( model="<copy-the-exact-API-model-ID>", messages=[{"role": "user", "content": "Say hello in one sentence."}],)print(response.choices[0].message.content)Run it while connected:
python demo.pyThe placeholder key works only through the configured, identity-aware VPN path. It does not authenticate public HTTPS requests. For authenticated CLI access, use the CLI example; the CLI uses your saved Tunnex login. Never replace the placeholder with the upstream provider key.
Connect an unattended application
Section titled “Connect an unattended application”Use AI Gateway → Access → Workloads for a service or bot that should not depend on a person’s VPN or browser session.
- Create a workload and select the exact models and modes it may use.
- Wait for Applied, then open Connect application.
- Create a single-instance or reusable enrollment key with an appropriate expiry and use limit. Save the one-time secret securely.
- Download the configuration. Provision its key file and private state directory for the application user using the workload setup steps.
- Enroll and launch with the provisioned configuration path:
tunnex workload enroll --config /run/secrets/tunnex/workload.jsontunnex workload run --config /run/secrets/tunnex/workload.json -- python app.pyThe wrapper supplies OPENAI_BASE_URL and OPENAI_API_KEY to the child process,
so a compatible application can use OpenAI() with the exact permitted model
ID. These settings belong to the local authenticated proxy; this is different
from the laptop VPN placeholder-key example.
- Check the workload’s Instances and usage. Preserve each instance’s private state across restarts; give replacement replicas independent state.
- To stop one instance, revoke it. Revoking only an enrollment key stops new joins; existing instances continue unless you select the accompanying instance revocation option. Disabling the workload blocks new calls and revokes its enrollment keys; re-enabling requires new keys for new instances.
See Workload identity for macOS paths, file permissions, retirement and preview limitations. Workload enrollment itself creates no VPN.
Enroll an AI agent
Section titled “Enroll an AI agent”- Prepare a supported Linux host and an eligible gateway with a usable endpoint.
- An owner enables Settings → AI Agents → Enable runtime synchronization before issuing the managed bootstrap command. Enable agent groups separately when you need group assignments or templates.
- Open AI Agents → Add agent, choose the name and gateway, and review.
- Issue the one-time command and run it on the intended host. Protect that command as a credential; do not paste it into tickets or shared logs.
- Open the agent and confirm owner, runtime status and recent handshake.
- Assign the model team and agent assignment under AI Agents → Model access. Wait for matching desired/applied state before calling a model.
- Add MCP and private-network access only as needed below.
Connected proves connectivity; it does not mean every model or tool is allowed. People-group grants do not replace an agent’s model assignment. Use AI Agents for bootstrap and lifecycle details. Check Activity and audit records when investigating behavior; workflow provenance is trusted only when its signature is verified, not because a caller supplied a workflow name.
Connect an MCP server
Section titled “Connect an MCP server”- In MCP, create a profile with a recognizable server name and its supported endpoint. Keep secrets out of the URL and ordinary metadata.
- Assign that profile to the intended agent group, then confirm the agent is in that group and its runtime is connected and synchronized.
- Ensure the runtime can reach the server. A private server also needs working DNS, routing and the applicable network permission.
- If OAuth is required, use the profile’s OAuth connection flow and authorize the intended account. Refresh tokens/client secrets stay in the control plane; transient access leases are delivered to runtime memory.
- Open the agent’s MCP controls and refresh discovery. Inspect the observed tools, source agent and freshness. The profile name alone does not establish a tool list.
- Configure MCP tool policy: allow only the required tools. Add argument constraints, rate limits or step-up approval where appropriate.
- Point the agent application at its runtime MCP proxy. Test one permitted tool and one denied tool. For step-up, approve the pending invocation and retry that exact invocation; approval is not a permanent tool grant.
- Review decisions in the agent’s activity and access/audit views.
Tool policy applies to calls through the managed MCP proxy. A direct call to the upstream server bypasses that proxy, so restrict alternative network paths where this boundary is required. See MCP security for the network and tool-control boundaries.
Why are no tools shown?
Section titled “Why are no tools shown?”Check, in order: profile assignment, runtime freshness, DNS/reachability, OAuth connection, then discovery errors. An added profile is saved configuration; observed inventory arrives from a runtime that can actually reach and discover the server. Do not treat an old snapshot as current availability. Reconnect OAuth when revoked or expired authorization prevents discovery, then refresh again.
Use policy templates for private network access
Section titled “Use policy templates for private network access”A policy template is reusable destination-and-port access for an agent group. For example, build agents may need one private database on its service port. Templates do not grant AI models or MCP tools.
- Enable Agent groups & policy templates and create the agent group.
- Define the private destination/resource under Access Policies.
- Open AI Agents → Policy templates, create a version and select the destination and allowed service ports.
- Preview the assignment impact, then apply it to the intended group.
- Check the generated managed rules and the gateway’s applied policy state.
- Verify the allowed destination/port and a destination/port that should fail.
- Withdraw the assignment when access is no longer needed, and verify the corresponding managed rules disappear.
Network restrictions require organization enforcement to be enabled. With network enforcement off, a template is not evidence that other traffic is blocked. Review the full allow policy before enabling enforcement on a live organization; follow Test and enforce policy.
Request temporary access
Section titled “Request temporary access”Just-in-time agent access is a separate licensed, organization-level opt-in. It starts off. An owner/admin enables it in organization settings when ready.
- Open the agent’s Access → Manage temporary access, or Access Policies → Just-in-time agent access.
- Select the agent and destination, give a reason and choose 15 minutes, 1 hour, 4 hours or 24 hours. Submit Request access.
- A pending request changes no policy. An authorized approver reviews it and approves or rejects it with a reason. A requester may cancel their pending request.
- After approval, check the exact expiry time and generated rule. The approved window starts when approved, not when requested.
- Use agent/state filters and Load more to find older requests. The agent link opens the relevant filtered view.
- Revoke approved access early if needed. At expiry the temporary grant is removed; inspect refreshed rules and history to confirm the change.
As with templates, actual network restriction requires enforcement. Other applicable permanent grants can still allow the same destination after temporary access expires. JIT network access does not replace MCP tool step-up approval.
Understand usage and troubleshoot
Section titled “Understand usage and troubleshoot”| What you see | Check next |
|---|---|
| No models in My models | Correct organization, user-group membership, enabled AI access, model grant and applied state |
| Cannot load provider connections | Private engine/bridge health and control-plane connectivity; retry after correcting the service error |
| HTTP 401 from the SDK | Active VPN identity path and copied base URL; a dummy key does not authenticate the public route |
| HTTP 403 | Caller grants, organization opt-in, current policy and any spending threshold; the code alone does not identify the cause |
| DNS resolves but TLS times out | Gateway HTTPS listener, certificate path, forwarding and tunnel transport/MTU; DNS success alone is insufficient |
| Provider Test Connect fails | Exact deployment, endpoint, credential, mode and reachability from the testing service |
| No MCP tools | Group assignment, runtime freshness, reachability, OAuth and discovery result |
| A model shows missing pricing | A cost estimate is unavailable, not free usage; a monetary threshold may refuse requests with unknown pricing |
| Non-chat operation fails | A deployment supporting that mode and its operation-specific request; do not use the chat-only example |
In Usage & cost, review model, team, agent or workload attribution as available. Estimates are not provider invoices. Daily USD thresholds use observed spending and can be exceeded by concurrent or already accepted requests; they are not hard spend caps. Do not interpret missing price data as zero cost.
When requesting support, include the operation, timestamp, HTTP status, request ID and relevant applied/runtime state. Keep provider keys, enrollment commands, OAuth secrets and private instance files out of shared logs.