app.nzapp
AppsProjectsReposPullsChatIntegrationsGatewayModelsEvalsToolsDatasetsMCPDeploysPricingBlogDocsAssistantsCharactersArtMusic
Sign inStart building
Agent stack
Cloud coding agentAgents SDKIntegrationsBrowser agentMonitors & auto-agentsSchedulersAgent skillsMCP serversDeep research
Models & API
AI GatewayModel catalogModel evalsModel spacesPlaygroundText to imageImage to 3DText to 3DMusic & SFXAudio editorMedia optimizerAI art & libraryChatAPI referenceSchemaBecome a provider
Compute & hosting
DeploysAddonsPostgres hostinggobed vector searchSite hostingAnalyticsCog GPU hostingRL trainingBuilds & CIWorkersTask queuesDomainsGit hosting
Tools
AI toolsDrawDiffusion canvasLive DrawWriteSheetsArtifactsVideo studioNotebooksDatasets
Learn
DocsBlogEval guidesPrompt libraryCLIAlternativesPapersAI charactersArt gallerySecurityConsulting
Company
PricingEnterpriseSettingsBillingStatusInvestorsCreate accountTerms of ServicePrivacy Policy
app.nzapp.nz

AI agent cloud for coding, deploys, model routing, and research. Built for teams shipping software.

Built in New Zealand by App AI NZ.

Social
X / TwitterGitHubYouTube
The app.nz network
GpuBrainPapersReading TimemojojojoNetwrckText-Generator.ioCodex InfinityOpenPathsCuteDSLAI Art GeneratorAIArt-Generator.artSiteSimSimplexGenDictatorFlowWebFiddleRing.nzChatGibidyBitBankExperimentFlowEvangelerHires.nzHow.nzV5 GamesAddicting Word GamesBig Multiplayer ChessWord SmashingreWord GameMultiplication Master
© 2026 App AI NZ Ltd. All rights reserved.All systems normalTermsPrivacy
Blog
July 7, 2026·5 min read·app.nz

BYOK provider keys in the model gateway

How app.nz lets users bring provider keys while keeping routing unified, validating providers, preferring user keys, hiding full secrets, and avoiding open-relay behavior.

Listen to this article

On-device voice

Uses the voice built into your browser; no article text leaves this page.

Audio narration is not supported by this browser.

The app.nz gateway supports bring-your-own-key because many teams already have provider contracts, credits, or compliance requirements. BYOK lets them route through app.nz without forcing all traffic onto app.nz-owned provider accounts.

The hard part is doing that without turning the gateway into an open relay or a secret-management accident.

One active key per provider

Users store provider keys under their account. The gateway keeps one active key per provider and revokes the old one when a replacement is saved. That keeps selection simple:

request resolves to provider look for user's active key for provider use it if present otherwise use platform key if configured otherwise skip that provider

This priority order is important. A user's BYOK key should win over the platform key because it is an explicit routing and billing choice.

Provider validation

The save endpoint validates that the provider exists in the model catalogue or in the embedded seed catalogue. That catches typos early and avoids storing random strings as provider names.

The embedded seed catalogue matters in fresh clones and CI. The platform should still understand common providers before the generated catalogue has been synced.

Secret storage

Provider keys are stored in the database with a prefix and last four characters for UI display. The full key can be encrypted at rest with the gateway secret key. If the encryption key is not configured, the server logs that BYOK storage is running without at-rest encryption.

The UI should never need the full key again. It needs:

  • provider,
  • prefix,
  • last four,
  • created time,
  • revoked status.

A key management screen should confirm what exists without handing secrets back to the browser.

Routing behavior

BYOK is not a separate gateway. It uses the same catalogue, fallback logic, provider adapters, logging, and metering code as platform-key traffic.

That avoids a common bug: the BYOK path working for simple OpenAI chat while failing for Anthropic, Google-compatible paths, images, or fallback chains. Key selection should be a small step inside the normal route, not a parallel implementation.

Abuse boundary

The gateway requires auth when no free platform key path is intended. An unauthenticated default would be an open relay, which is both expensive and abusable.

BYOK helps here because a caller can use app.nz routing while still being accountable to their own upstream provider. But app.nz still needs to enforce its own auth, rate limits, and model access rules.

Why teams want it

BYOK is not just about cost. It lets teams:

  • keep usage under existing enterprise agreements,
  • test app.nz routing without moving procurement,
  • isolate provider spend by account,
  • use providers app.nz supports but does not fund globally,
  • retain analytics in app.nz while billing upstream directly.

The product goal is to make the key boring. Users should save it once, see that it is active, and then keep using the same model names and APIs.

Build what you just read

Ship agents, models, and apps on one cloud.

Start with free credits, then use the same platform from the web app, CLI, desktop app, or MCP.

Start building freeRead the docs

Keep reading

Dynamic routing across model providers

How the app.nz gateway resolves aliases, classifies auto routes, chooses BYOK or platform keys, walks fallback chains, adapts provider APIs, and meters usage from one catalogue.

Metering the model gateway without guessing

How app.nz meters token streams, image responses, media jobs, BYOK traffic, failures, and routed provider/model pairs from the same catalogue used for pricing.

What is an AI agent cloud?

Why app.nz is broader than a coding agent, model gateway, inference provider, or app host—and how one integrated loop changes the work of shipping AI software.