Anthropic API
Using the Anthropic API in your bots
The lil’bots platform comes with Anthropic access built in. You can use the Anthropic API to build bots that can generate text.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Using the Anthropic API in your bots
import Anthropic from 'npm:@anthropic-ai/sdk';
const anthropic = new Anthropic();
export async function main(inputs, params) {
const { prompt } = inputs;
const msg = await anthropic.messages.create({
model: "claude-3-5-sonnet-20240620",
max_tokens: 1024,
messages: [{ role: "user", content: prompt }],
});
const response = msg.content[0].text;
return {
message: response
}
}