import type { NullableHeaders } from "./internal/headers.mjs"; import { BaseAnthropic, ClientOptions } from '@anthropic-ai/sdk/client'; import * as Resources from '@anthropic-ai/sdk/resources/index'; import { AwsCredentialIdentityProvider } from '@smithy/types'; import type { Middleware } from "./core/middleware.mjs"; import { FinalRequestOptions } from "./internal/request-options.mjs"; export interface BedrockMantleClientOptions extends ClientOptions { /** * AWS region for the Bedrock Mantle API. * * Resolved by precedence: `awsRegion` arg > `AWS_REGION` env var > `AWS_DEFAULT_REGION` env var. */ awsRegion?: string | undefined; /** * API key for Bearer token authentication. * * Takes precedence over AWS credential options. If neither `apiKey` nor * AWS credentials are provided, falls back to the `AWS_BEARER_TOKEN_BEDROCK` * environment variable, then to the default AWS credential chain. */ apiKey?: string | undefined; /** * AWS access key ID for SigV4 authentication. * * Must be provided together with `awsSecretAccessKey`. */ awsAccessKey?: string | null | undefined; /** * AWS secret access key for SigV4 authentication. * * Must be provided together with `awsAccessKey`. */ awsSecretAccessKey?: string | null | undefined; /** * AWS session token for temporary credentials. */ awsSessionToken?: string | null | undefined; /** * AWS named profile for credential resolution. * * When set, credentials are loaded from the AWS credential chain * using this profile. */ awsProfile?: string | undefined; /** * Custom provider chain resolver for AWS credentials. * Useful for non-Node environments, like edge workers, where the default * credential provider chain may not work. */ providerChainResolver?: (() => Promise) | null; /** * Skip authentication for requests. This is useful when you have a gateway * or proxy that handles authentication on your behalf. * * @default false */ skipAuth?: boolean; } /** * API Client for interfacing with the Anthropic Bedrock Mantle API. * * This client uses SigV4 authentication with the `bedrock-mantle` service name * and targets `https://bedrock-mantle.{region}.api.aws/anthropic`. * * Only the `messages` and `beta.messages` resources are supported. */ export declare class AnthropicBedrockMantle extends BaseAnthropic { #private; messages: Resources.Messages; beta: MantleBetaResource; awsRegion: string | undefined; awsAccessKey: string | null; awsSecretAccessKey: string | null; awsSessionToken: string | null; awsProfile: string | null; providerChainResolver: (() => Promise) | null; skipAuth: boolean; private _useSigV4; /** * API Client for interfacing with the Anthropic Bedrock Mantle API. * * Auth is resolved by precedence: `apiKey` constructor arg > explicit AWS * credentials > `awsProfile` > `AWS_BEARER_TOKEN_BEDROCK` env var > default * AWS credential chain. * * @param {string | undefined} [opts.apiKey] - API key for Bearer token authentication. * @param {string | null | undefined} [opts.awsAccessKey] - AWS access key ID for SigV4 authentication. * @param {string | null | undefined} [opts.awsSecretAccessKey] - AWS secret access key for SigV4 authentication. * @param {string | null | undefined} [opts.awsSessionToken] - AWS session token for temporary credentials. * @param {string | undefined} [opts.awsProfile] - AWS named profile for credential resolution. * @param {string | undefined} [opts.awsRegion] - AWS region. Resolved by precedence: arg > `AWS_REGION` env > `AWS_DEFAULT_REGION` env. * @param {(() => Promise) | null} [opts.providerChainResolver] - Custom provider chain resolver for AWS credentials. * @param {string} [opts.baseURL=process.env['ANTHROPIC_BEDROCK_MANTLE_BASE_URL'] ?? https://bedrock-mantle.{awsRegion}.api.aws/anthropic] - Override the default base URL for the API. * @param {number} [opts.timeout=10 minutes] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out. * @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls. * @param {Fetch} [opts.fetch] - Specify a custom `fetch` function implementation. * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request. * @param {HeadersLike} opts.defaultHeaders - Default headers to include with every request to the API. * @param {Record} opts.defaultQuery - Default query parameters to include with every request to the API. * @param {boolean} [opts.dangerouslyAllowBrowser=false] - By default, client-side use of this library is not allowed, as it risks exposing your secret API credentials to attackers. * @param {boolean} [opts.skipAuth=false] - Skip authentication for requests. This is useful when you have a gateway or proxy that handles authentication on your behalf. */ constructor({ awsRegion, baseURL, apiKey, awsAccessKey, awsSecretAccessKey, awsSessionToken, awsProfile, providerChainResolver, skipAuth, ...opts }?: BedrockMantleClientOptions); protected authHeaders(opts: FinalRequestOptions): Promise; protected validateHeaders(): void; protected backendMiddleware(): ReadonlyArray; } /** * Bedrock Mantle does not support completions, models, or non-messages beta resources. */ type MantleBetaResource = Pick; export {}; //# sourceMappingURL=mantle-client.d.mts.map