Skip to content

Authentication and BYOK

Provide Authorization: Bearer <BiomAPI-key> or ?api_key=<key>. Public access requires no key and uses smaller per-IP daily quotas. Authenticated quotas remain per user; server-default queue admission identifies callers by their actual BiomAPI key.

Create a key in OpenRouter settings. Provide X-OpenRouter-API-Key: <key> for PDF/image processing. It overrides assigned, Vertex-first, and server-default credentials and uses the independent biomai_byok daily bucket. JSON does not call a provider. Provider spend is billed to your OpenRouter account; BiomAPI credits are separate operation allowances.

Terminal window
curl --fail-with-body https://biomapi.com/api/v1/biom/process \
-H "X-OpenRouter-API-Key: $OPENROUTER_API_KEY" \
-F "file=@report.pdf"

All OpenRouter requests require ZDR endpoints, denied data collection, supported parameters, disabled response caching and native PDF handling. Before sending clinical data, disable account input/output logging and observability broadcasts. Key owners control their own account settings and downstream terms; request-level ZDR does not cover every plugin, tool, log or metadata record. See privacy.

The web app stores entered keys locally on the device. Old Google BYOK values are invalidated on this migration. Never include keys in report JSON, shared links, analytics or source control.

Your BiomAPI key determines whether PDF/image extraction is available without BYOK. If server-managed extraction is disabled for your key, provide an OpenRouter key or contact support. OpenRouter retries keep the same credentials; a failed BYOK request never falls back to server funding. See processing capacity.

Selected authenticated BiomAPI keys may be configured by the operator to use an assigned Google Cloud Vertex credential first. No new client header is needed. The first attempt has 8 seconds to produce answer text; metadata and thought chunks do not count. Once output starts, the normal attempt deadline applies. Transient failures can fall back to the server’s OpenRouter key within the original workflow deadline, including after partial output. Partial results are discarded. Invalid credentials, permanent errors, refusals, and invalid completed output do not trigger fallback. OpenRouter BYOK always overrides this route.

The entire request consumes one caller BiomAI credit. Fallback also needs available server capacity and global allowance. See credits and limits and privacy for accounting and provider data flows.

GET /api/v1/biom/usage?validate=true checks the provided OpenRouter key through OpenRouter’s read-only key endpoint. The provider key status is in keys.openrouter. The header is X-OpenRouter-API-Key. A timeout or unavailable validation service returns valid: null, not an invalid-key result. The retired X-Gemini-API-Key header is explicitly rejected by processing to stop unintended shared funding. See migration.