Anthropic configuration
Configuration for Anthropic endpoints
Configuration
The Velvet gateway domain is gateway.usevelvet.com
.
Modify the baseURL
for Velvet's gateway URL.
https://gateway.usevelvet.com/api/anthropic/
Here's an example code snippet for the Anthropic SDK in JavaScript.
import Anthropic from "@anthropic-ai/sdk";
const anthropic = new Anthropic({
apiKey: process.env.ANTHROPIC_API_KEY,
baseURL: "https://gateway.usevelvet.com/api/anthropic/",
defaultHeaders: {
"velvet-auth": process.env.VELVET_API_KEY,
},
});
If you use the Vercel AI SDK, use this code snippet.
import { createAnthropic } from '@ai-sdk/anthropic';
const anthropic = createAnthropic({
apiKey: process.env.ANTHROPIC_API_KEY,
baseURL: "https://gateway.usevelvet.com/api/anthropic/v1",
headers: {
"velvet-auth": process.env.VELVET_API_KEY,
}
});
Email us at [email protected] if you need help with any other SDKs.
Updated about 2 months ago