Operate
Deploy an agent to test or prod, roll back to a previous version, point a custom domain at it, embed it in a webpage, and route model calls through your own cloud account. All via the SDK.
Deploy to test and to prod
Configure creates an agent version (a snapshot). Deploying that version runs it on the backend. You pick the destination:
// the configure call returned:
// const v = { agentId: 'agt_2b8e', versionId: 'ver_3c5f' }
// dev-only URL — no end-user traffic, ephemeral
const test = await an.agents.deployToTest(v.versionId);
// → { url: 'https://<temp>.test.agents.agentnava.com', expiresAt: '…' }
// production URL — end users hit this
const prod = await an.agents.deployToProd(v.versionId);
// → { url: 'https://<agent-name>.agents.agentnava.com', versionNumber: 4 }
Both calls are idempotent on the version ID. deployToProd promotes the version atomically and keeps the previous one warm until the new one passes a health check. Skip deployToTest if you don't need a dev-only environment.
Versions & rollback
// list every version of this agent (newest first)
const versions = await an.agents.versions('agt_2b8e');
// → [{ id: 'ver_3c5f', number: 4, deployedAt: '…', isProd: true }, …]
// instant rollback to a previous version
await an.agents.rollback('agt_2b8e', 'ver_9a1b');
Rollback is instant — every version's spec content and configuration is preserved as long as the agent exists.
Custom domain
Map agent.yourdomain.com to the agent's public URL via CNAME, then attach it in code:
await an.domains.add({
domain: 'agent.yourdomain.com',
agentId: 'agt_2b8e',
});
The runtime provisions a managed TLS cert and serves the agent at that domain within a minute.
Embed snippet
<script
src="https://embed.agentnava.com/v1.js"
data-agent="<agentId>"
data-theme="auto"
defer
></script>
Drops into any HTML page. The widget creates a session automatically on first message and resumes it across reloads (session ID in localStorage). data-theme accepts light, dark, or auto. Add data-uploads="true" to enable end-user file attachments.
BYOK — bring your own keys
Route inference through your own cloud account. The runtime still runs on AgentNava; only model calls hit the chosen provider. Attach credentials once per workspace — they're validated with a small probe call before any agent uses them.
In your configure call, omit provider or set it to 'auto':
await an.agents.configure({
// ...
provider: 'auto', // or omit entirely
});
Attach an IAM user (or assume-role ARN) with bedrock:InvokeModelWithResponseStream on the models you'll use:
await an.byok.bedrock.set({
accessKey: 'AKIA…',
secretKey: process.env.AWS_SECRET,
region: 'us-west-2',
});
Then in configure:
await an.agents.configure({
// ...
provider: 'bedrock',
});
await an.byok.azureOpenai.set({
resource: 'my-resource',
apiKey: process.env.AZURE_OPENAI_KEY,
deployments: { // map our classes to your deployment names
standard: 'gpt-4o-mini-deploy',
premium: 'gpt-4o-deploy',
advanced: 'o1-deploy',
},
});
await an.agents.configure({
// ...
provider: 'azure-openai',
});
Attach a service-account JSON with aiplatform.endpoints.predict on the relevant Vertex models:
import { readFileSync } from 'fs';
await an.byok.vertex.set({
serviceAccount: JSON.parse(readFileSync('./sa.json', 'utf8')),
project: 'my-gcp',
region: 'us-central1',
});
await an.agents.configure({
// ...
provider: 'vertex',
});
await an.byok.openrouter.set({
apiKey: process.env.OPENROUTER_KEY,
});
await an.agents.configure({
// ...
provider: 'openrouter',
});
Regions
Agents deploy to the region closest to the workspace owner by default. Override on a per-agent basis via meta:
await an.agents.configure({
// ...
meta: { region: 'eu-west' },
});
Supported: us-west, us-east, eu-west, eu-central, ap-southeast.
Billing
The runtime is charged per workspace plan; model usage is metered separately. With provider: 'auto', model calls are billed by AgentNava. With BYOK, they're billed by your cloud provider. Plan details and pricing are on agentnava.com/pricing.