1---
2# Passthrough access to Anthropic's Claude API, with the platform's API key.
3# Use the Anthropic SDK, with this Proxy's URL, without its v1/, as its base_url, and a Smarter
4# API key as its api_key, which the SDK sends in the x-api-key header:
5#
6# client = Anthropic(base_url="https://<smarter>/api/v1/proxy/anthropic/", api_key="<Smarter API key>")
7#
8# The SDK adds /v1/ to its paths, so the Proxy's baseUrl does not include it. Anthropic expects
9# its API key in x-api-key, without a scheme, and requires the anthropic-version header.
10apiVersion: smarter.sh/v1
11kind: Proxy
12metadata:
13 name: anthropic
14 description: Passthrough access to Anthropic's Messages API, for Claude.
15 version: 1.0.0
16 tags:
17 - anthropic
18 - claude
19 - builtin
20 annotations:
21 - smarter.sh/proxy/builtin: "true"
22 - smarter.sh/proxy/documentation: https://docs.claude.com/en/api/messages
23spec:
24 provider: anthropic
25 apiKey: anthropic_api_key
26 baseUrl: https://api.anthropic.com/
27 auth:
28 header: x-api-key
29 scheme: ""
30 headers:
31 anthropic-version: "2023-06-01"
32 allowedPaths:
33 - v1/messages
34 - v1/messages/count_tokens
35 - v1/models
36 - v1/models/*
37 timeout: 300
38 isActive: true