Update claude-api skill: Claude Opus 5 (#1476)

* Update claude-api skill: Claude Opus 5

- Add Claude Opus 5 (`claude-opus-5`) as the default model across all
  SDK examples, model tables, pricing, and migration guidance.
- Add an Opus 5 migration section covering the API changes that come
  with it, and move Opus 4.8 into the previous-generation slot.
- Drop the Opus 4.7 fast-mode guidance, which no longer applies.
- Scope the server-side fallbacks beta header to the current version.

* Update claude-api skill: Opus 5 fast-follow corrections

- Server-side refusal fallbacks are available on Claude Platform on AWS,
  not just the Claude API. Correct the availability statements in
  SKILL.md, the migration guide, and the platform-availability table.
- Simplify the effort guidance: start at `high` (the API default) and
  sweep down, rather than starting at `xhigh` for coding work.
- Add a time-to-first-token section with the prompt instruction that
  reduces pre-answer thinking on latency-sensitive routes.
- Replace the two separate thinking-disabled mitigations with the single
  combined instruction that covers both failure modes.
This commit is contained in:
Lance Martin
2026-07-24 13:12:34 -07:00
committed by GitHub
parent 1f630fdf92
commit b29e7cf65e
50 changed files with 608 additions and 278 deletions
+7 -6
View File
@@ -26,7 +26,7 @@ use Anthropic\Bedrock\MantleClient;
$client = new MantleClient(awsRegion: 'us-east-1');
```
Model IDs on Bedrock take an `anthropic.` prefix — e.g. `model: 'anthropic.claude-opus-4-8'`.
Model IDs on Bedrock take an `anthropic.` prefix — e.g. `model: 'anthropic.claude-opus-5'`.
### Google Vertex AI
@@ -58,7 +58,7 @@ $client = Foundry\Client::withCredentials(
```php
$message = $client->messages->create(
model: 'claude-opus-4-8',
model: 'claude-opus-5',
maxTokens: 16000,
messages: [
['role' => 'user', 'content' => 'What is the capital of France?'],
@@ -97,9 +97,9 @@ foreach ($message->content as $block) {
use Anthropic\Messages\ThinkingBlock;
$message = $client->messages->create(
model: 'claude-opus-4-8',
model: 'claude-opus-5',
maxTokens: 16000,
thinking: ['type' => 'adaptive', 'display' => 'summarized'], // display opt-in: default is omitted (empty thinking text) on Fable 5 / Mythos 5 / Opus 4.8 / 4.7
thinking: ['type' => 'adaptive', 'display' => 'summarized'], // display opt-in: default is omitted (empty thinking text) on Fable 5 / Mythos 5 / Claude Opus 5 / Opus 4.8 / 4.7
messages: [
['role' => 'user', 'content' => 'Solve: 27 * 453'],
],
@@ -117,7 +117,8 @@ foreach ($message->content as $block) {
}
```
> **Fable 5, Opus 4.8, Opus 4.7, Opus 4.6, and Sonnet 4.6:** Use adaptive thinking (above). `['type' => 'enabled', 'budgetTokens' => N]` is removed on Fable 5, Opus 4.8, and 4.7 (400 if sent); deprecated on Opus 4.6 and Sonnet 4.6.
> **Fable 5, Claude Opus 5, Opus 4.8, Opus 4.7, Opus 4.6, and Sonnet 4.6:** Use adaptive thinking (above). `['type' => 'enabled', 'budgetTokens' => N]` is removed on Fable 5, Claude Opus 5, Opus 4.8, and 4.7 (400 if sent); deprecated on Opus 4.6 and Sonnet 4.6.
> **Claude Opus 5:** thinking is on by default — omitting `thinking:` runs adaptive (`['type' => 'adaptive']` is equivalent), unlike Opus 4.8/4.7 where omitting it meant no thinking. `['type' => 'disabled']` is accepted only at effort `high` or lower; pairing it with `xhigh`/`max` returns a 400.
> **Older models:** Use `thinking: ['type' => 'enabled', 'budgetTokens' => N]` (budget must be < `maxTokens`, min 1024).
`$block->type === 'thinking'` also works for the check; `instanceof` narrows for PHPStan.
@@ -130,7 +131,7 @@ foreach ($message->content as $block) {
```php
$message = $client->messages->create(
model: 'claude-opus-4-8',
model: 'claude-opus-5',
maxTokens: 16000,
system: [
['type' => 'text', 'text' => $longSystemPrompt, 'cacheControl' => ['type' => 'ephemeral']],
+1 -1
View File
@@ -4,7 +4,7 @@
```php
$batch = $client->messages->batches->create(requests: [
['customId' => 'req-1', 'params' => ['model' => 'claude-opus-4-8', 'maxTokens' => 1024, 'messages' => [...]]],
['customId' => 'req-1', 'params' => ['model' => 'claude-opus-5', 'maxTokens' => 1024, 'messages' => [...]]],
['customId' => 'req-2', 'params' => [...]],
]);
// Poll $client->messages->batches->retrieve($batch->id) until processingStatus === 'ended',
@@ -9,7 +9,7 @@ use Anthropic\Messages\RawContentBlockDeltaEvent;
use Anthropic\Messages\TextDelta;
$stream = $client->messages->createStream(
model: 'claude-opus-4-8',
model: 'claude-opus-5',
maxTokens: 64000,
messages: [
['role' => 'user', 'content' => 'Write a haiku'],
+8 -8
View File
@@ -31,7 +31,7 @@ $weatherTool = new BetaRunnableTool(
$runner = $client->beta->messages->toolRunner(
maxTokens: 16000,
messages: [['role' => 'user', 'content' => 'What is the weather in Paris?']],
model: 'claude-opus-4-8',
model: 'claude-opus-5',
tools: [$weatherTool],
);
@@ -68,7 +68,7 @@ $tools = [
$messages = [['role' => 'user', 'content' => 'What is the weather in SF?']];
$response = $client->messages->create(
model: 'claude-opus-4-8',
model: 'claude-opus-5',
maxTokens: 16000,
tools: $tools,
messages: $messages,
@@ -95,7 +95,7 @@ while ($response->stopReason === 'tool_use') { // camelCase property
$messages[] = ['role' => 'user', 'content' => $toolResults];
$response = $client->messages->create(
model: 'claude-opus-4-8',
model: 'claude-opus-5',
maxTokens: 16000,
tools: $tools,
messages: $messages,
@@ -139,7 +139,7 @@ class Person implements StructuredOutputModel
}
$message = $client->messages->create(
model: 'claude-opus-4-8',
model: 'claude-opus-5',
maxTokens: 16000,
messages: [['role' => 'user', 'content' => 'Generate a profile for Alice, age 30']],
outputConfig: ['format' => Person::class],
@@ -155,7 +155,7 @@ Types are inferred from PHP type hints. Use `#[Constrained(description: '...')]`
```php
$message = $client->messages->create(
model: 'claude-opus-4-8',
model: 'claude-opus-5',
maxTokens: 16000,
messages: [['role' => 'user', 'content' => 'Extract: John (john@co.com), Enterprise plan']],
outputConfig: [
@@ -194,7 +194,7 @@ foreach ($message->content as $block) {
use Anthropic\Beta\Messages\BetaRequestMCPServerURLDefinition;
$response = $client->beta->messages->create(
model: 'claude-opus-4-8',
model: 'claude-opus-5',
maxTokens: 16000,
mcpServers: [
BetaRequestMCPServerURLDefinition::with(
@@ -211,7 +211,7 @@ $response = $client->beta->messages->create(
```php
$response = $client->beta->messages->create(
model: 'claude-opus-4-8',
model: 'claude-opus-5',
maxTokens: 16000,
outputConfig: ['taskBudget' => ['type' => 'tokens', 'total' => 64000]],
tools: [...],
@@ -226,7 +226,7 @@ Pass the previous response's `id` on the next request; print the `diagnostics` o
```php
$r2 = $client->beta->messages->create(
model: 'claude-opus-4-8', maxTokens: 1024,
model: 'claude-opus-5', maxTokens: 1024,
diagnostics: ['previousMessageId' => $r1->id],
betas: ['cache-diagnosis-2026-04-07'],
messages: [...],
@@ -48,7 +48,7 @@ use Anthropic\Beta\Agents\BetaManagedAgentsAgentToolset20260401Params;
// 1. Create the agent (reusable, versioned)
$agent = $client->beta->agents->create(
name: 'Coding Assistant',
model: 'claude-opus-4-8',
model: 'claude-opus-5',
system: 'You are a helpful coding assistant.',
tools: [
BetaManagedAgentsAgentToolset20260401Params::with(
@@ -307,7 +307,7 @@ use Anthropic\Beta\Sessions\BetaManagedAgentsAgentParams;
// Agent declares MCP server (no auth here — auth goes in a vault)
$agent = $client->beta->agents->create(
name: 'GitHub Assistant',
model: 'claude-opus-4-8',
model: 'claude-opus-5',
mcpServers: [
BetaManagedAgentsURLMCPServerParams::with(
type: 'url',