Skip to content

1.8.0

Latest

Choose a tag to compare

@mozex mozex released this 01 Aug 13:49
· 1 commit to main since this release
Immutable release. Only release title and notes can be modified.
6cd2623

What's Changed

Added

Server-side fallback for refused requests

  • On Claude Fable 5 and Opus 5 you can pass 'fallbacks' => 'default' with the server-side-fallback-2026-07-01 beta so the API retries a refused request on another model instead of returning the refusal. The response DTOs from anthropic-php 1.8.0 parse the whole flow: the fallback content block, per-attempt usage->iterations, and stop_details->recommended_model.
use Anthropic\Laravel\Facades\Anthropic;
use Illuminate\Support\Facades\Log;

$response = Anthropic::messages()->create([
    'model' => 'claude-fable-5',
    'max_tokens' => 1024,
    'fallbacks' => 'default',
    'betas' => ['server-side-fallback-2026-07-01'],
    'messages' => [['role' => 'user', 'content' => $prompt]],
]);

foreach ($response->usage->iterations ?? [] as $iteration) {
    if ($iteration->type === 'fallback_message') {
        Log::info('Served by fallback model', ['model' => $iteration->model]);
    }
}

Improved

Documentation

  • The Messages guide covers the expanded refusal categories (frontier_llm, reasoning_extraction, general_harms) and the new fallback section with a logging pattern, so refusal metrics don't misreport which model answered.
  • The Server Tools guide mentions the latest web_search_20260318 version and its response_inclusion parameter.

Boost skill

  • The refusal section of resources/boost/skills/anthropic-laravel/SKILL.md picks up the expanded category list and a pointer to the fallback flow, so AI assistants working in your app suggest current values.

Dependency

  • Bump mozex/anthropic-php to ^1.8.0. Everything in that release flows through the facade automatically: usage->outputTokensDetails (thinking token breakdown), usage->speed (fast mode), usage->iterations, compaction content blocks and context_management, and cache diagnostics. See the PHP 1.8.0 release notes for details and examples.

Full Changelog: 1.7.0...1.8.0