The lil’bots platform comes with Anthropic access built in. You can use the Anthropic API to build bots that can generate text.

Using the Anthropic API

You can make requests to any v1 endpoint in the Anthropic API without including an API key. The requests will be recognized and authorized by the lil’bots platform.

To read the full Anthropic API documentation, visit the Anthropic API Reference.

Using the Anthropic SDK - JavaScript Runtime

You can use the Anthropic SDK in your bots to make requests to the Anthropic API. The SDK is available in the JavaScript runtime by installing it from NPM:

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
  }
}