Skip to content

Boat.Credential Profile reference

Source: packages/boat/src/CredentialProfile.ts

A Boat credential profile: a named set of API keys that Boat stores encrypted and hands to the sandboxes of an environment that names it.

A profile holds provider API keys (Anthropic, OpenAI, …) and custom APIs: a secret for any other HTTPS API, with the base URL it is sent to. Boat never returns a secret once it is stored.

The API keys and custom APIs of a declared profile are exactly the ones its props list: a deploy removes any other. Sign-ins (a Claude or ChatGPT subscription) and Bedrock are connected on Boat’s dashboard and left alone.

A profile is personal, or owned by an organization. With an org on the stack (Boat.providers({ org }), or the profile’s) the organization owns it: every member’s sandboxes can use it, and only owners change it. Without one it is yours. Changing the stack’s org replaces it.

Provider API keys

export const MyProfile = Boat.CredentialProfile("MyProfile", {
anthropic: Config.Redacted("ANTHROPIC_API_KEY"),
openai: Config.Redacted("OPENAI_API_KEY"),
});

A secret for any other API

export const Payments = Boat.CredentialProfile("Payments", {
apis: {
STRIPE_KEY: {
key: Config.Redacted("STRIPE_KEY"),
baseUrl: "https://api.stripe.com/v1",
},
},
});

A sandbox gets STRIPE_KEY and STRIPE_KEY_BASE_URL. Send requests to $STRIPE_KEY_BASE_URL, not to the API’s own address, so the same code works when the AI credentials proxy replaces both.

CredentialProfile: Giving sandboxes a profile

Section titled “CredentialProfile: Giving sandboxes a profile”

Name it on an environment

export const MyProfile = Boat.CredentialProfile("MyProfile", {
anthropic: Config.Redacted("ANTHROPIC_API_KEY"),
});
export const MyEnv = Boat.Environment("MyEnv", { credentialProfile: MyProfile });
export const Box = Boat.Sandbox("Box", { environment: MyEnv });

Placeholders instead of real keys

export const MyProfile = Boat.CredentialProfile("MyProfile", {
anthropic: Config.Redacted("ANTHROPIC_API_KEY"),
});
// Billed: $1 a day, plus $1 per 1,000 proxied requests.
export const Proxy = Boat.AiProxy("Proxy", { enabled: true });
export const Tenants = Boat.Environment("Tenants", {
safeForThirdParties: true,
credentialProfile: MyProfile,
proxyAiCredentials: Proxy,
});

CredentialProfile: Referencing a profile the stack doesn’t manage

Section titled “CredentialProfile: Referencing a profile the stack doesn’t manage”
export const MyEnv = Boat.Environment("MyEnv", {
credentialProfile: Boat.CredentialProfile.lookup({ name: "default" }),
});