What's Changed
Added
Server-side fallback for refused requests
- On Claude Fable 5 and Opus 5 you can pass
'fallbacks' => 'default'with theserver-side-fallback-2026-07-01beta so the API retries a refused request on another model instead of returning the refusal. The response DTOs fromanthropic-php1.8.0 parse the whole flow: thefallbackcontent block, per-attemptusage->iterations, andstop_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_20260318version and itsresponse_inclusionparameter.
Boost skill
- The refusal section of
resources/boost/skills/anthropic-laravel/SKILL.mdpicks 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-phpto^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 andcontext_management, and cache diagnostics. See the PHP 1.8.0 release notes for details and examples.
Full Changelog: 1.7.0...1.8.0