Baseten configuration#
Cartography reads your Baseten organization through the read-only GET endpoints of the
Baseten Management API. It
needs one Baseten API key. The API is scoped to the key’s organization, so you don’t pass an
organization ID.
Authentication#
Baseten filters several Management API responses by the role of the key’s owner, so use a key that can see the whole organization:
Required: a personal API key that belongs to an organization Admin. It’s the only key type that can read the organization’s members, every team, every team API key, and every member’s personal API keys.
A team API key with Full access to all team models reads only its own team’s models, Chains, and secrets. Don’t use one for an organization-wide inventory.
An API key management key (
WORKSPACE_MANAGE_API_KEYS) can only list teams, models, and API keys. Cartography can’t sync the rest of the organization with it.
Baseten can return successful list responses with only the resources the key can see.
After each sync, Cartography removes Baseten nodes and relationships that the key no
longer returns, so keep organization Admin access when rotating the key. To sync with a
key that can’t see the full organization, pass --baseten-skip-cleanup; Cartography then
loads the available inventory and keeps previously synced nodes and relationships.
Baseten requires personal API keys to expire within 90 days, or sooner if your organization sets a shorter limit, and revokes personal keys that go unused for 30 days. Rotate the key before it expires. A daily sync keeps it from being revoked for inactivity.
To create the key, sign in to app.baseten.co as an organization Admin, open Organization settings > API keys, choose Create API key, and select Personal. Store the key in an environment variable.
Required permissions#
Cartography calls these endpoints:
Endpoint |
Ingests |
Who can read it |
|---|---|---|
|
|
Any API key. |
|
|
Teams the key’s owner can access. Organization Admins see every team. |
|
|
Not documented. Use an organization Admin’s key. |
|
|
Viewer role or higher in the model’s team. |
|
|
Viewer role or higher in the team. |
|
|
Organization Admins see every key. Team Admins see their teams’ keys. Other users see their own keys. |
|
|
Not documented. Use an organization Admin’s key. |
Cartography fetches every endpoint, including all pages and per-team
responses, before writing to Neo4j. If an API request fails, for example with
403 Forbidden or a timeout, the Baseten sync stops and leaves the previous sync’s
nodes and relationships unchanged. Once loading starts, database writes and cleanup
commit in separate transactions; a database failure can leave partial updates.
BasetenApiKey.id combines the organization ID and key prefix as
<organization_id>/<prefix>. Use BasetenApiKey.prefix to query the original
Baseten prefix.
Configure Cartography#
Option |
Description |
|---|---|
|
Name of the environment variable that holds the Baseten API key. |
|
Keep stale nodes and relationships instead of removing them after the sync. Use when the API key can’t see the full organization. |
Run Cartography#
export BASETEN_API_KEY='<api-key>'
cartography \
--selected-modules baseten \
--baseten-api-key-env-var BASETEN_API_KEY