All provider guides

Set up Anthropic

PHPTypeScriptPython

Researched from Anthropic's official documentation on 2026-11-02. Not yet walked through end to end.

Open your Anthropic console (sign-in required)

  1. Current: Choose an organization and workspace

    Sign in or create an account in the Claude Console. Select the organization and workspace for your application.

  2. Not started: Create a scoped API key

    Open API keys, choose Create key, give it a name and expiration, and select yourself or the service account that should own it. Scope it to the intended workspace.

  3. Not started: Store the key privately

    Copy the key once into your own secret storage. If your role cannot create keys, ask the organization administrator.

  4. Not started: Configure your .env

    Use the environment names below in your own application. Keep its environment file out of source control. Never paste a key into this website.

  5. Not started: Run the local check

    Choose a model you can use and run the matching example below on your own machine. Check any applicable usage charges first.

Configure and verify locally

Environment names and defaults below come from the installed package. Choose a model you can use by setting PRISM_SETUP_MODEL on your machine. Run the verification only when you are ready for one billed request. No request is sent by this page.

Approximate text cost is input tokens × your model’s input rate, plus at most 32 output tokens × its output rate, divided by the rate’s token unit. Add any provider fees. Check your model and region’s current price; the token limit is not a money cap.

php environment names
# Set ANTHROPIC_API_KEY privately if required for your configuration.
# version (default)
# ANTHROPIC_API_VERSION=2023-06-01
# url (default)
# ANTHROPIC_URL=https://api.anthropic.com/v1
# default_thinking_budget (default)
# ANTHROPIC_DEFAULT_THINKING_BUDGET=1024
# Set ANTHROPIC_BETA privately if required for your configuration.
php local verification
use Prism\Prism\Facades\Prism;

// Run in your own configured Laravel app (for example, php artisan tinker).
$model = getenv('PRISM_SETUP_MODEL');
if (!$model) {
    throw new RuntimeException('Set PRISM_SETUP_MODEL to your model.');
}
try {
    $result = Prism::text()
        ->using('anthropic', $model)
        ->withPrompt('Say hello.')
        ->withMaxTokens(32)
        ->asText();
    echo $result->text, PHP_EOL;
} catch (Throwable $error) {
    echo get_class($error), PHP_EOL;
}

Official sources