Anthropic Provider Token Reporting Issues with Telemetry

### Description

When using `experimental_telemetry` with the Anthropic provider, there are two issues with token reporting:
1. Provider metadata incorrectly reports `output_tokens: 1` instead of the actual count
2. Cache write tokens are not included in `totalTokens` (and hence not in .usage as they don't have their own field like `cachedInputTokens`).
    > This feels like an artifact of dealing with so many different provider formats, and I can understand if it's a wontfix. However I'd request that for providersV3 if we could move towards what has become a popular the usage object e.g. `[input, output, cachewrite, cacheread, total (sum of i+o+cr+cw)]`

## Example
First call (cache write):
```
Usage: {
  inputTokens: 4,
  outputTokens: 104,
  totalTokens: 108,
  cachedInputTokens: 0
}
Attrs: {
    "ai.response.model": "claude-3-5-haiku-20241022",
    "ai.usage.inputTokens": 4,
    "ai.usage.outputTokens": 104,
    "ai.usage.totalTokens": 108,
    "ai.usage.cachedInputTokens": 0,
    "ai.response.providerMetadata": "{\"anthropic\":{\"usage\":{\"input_tokens\":4,\"output_tokens\":1,\"cache_creation_input_tokens\":2183,...}}}",
    "gen_ai.usage.input_tokens": 4,
    "gen_ai.usage.output_tokens": 104
}
```

Second call (cache read):
```
Usage: {
  inputTokens: 4,
  outputTokens: 141,
  totalTokens: 145,
  cachedInputTokens: 2183
}
Attrs: {
    "ai.response.model": "claude-3-5-haiku-20241022",
    "ai.usage.inputTokens": 4,
    "ai.usage.outputTokens": 141,
    "ai.usage.totalTokens": 145,
    "ai.usage.cachedInputTokens": 2183,
    "ai.response.providerMetadata": "{\"anthropic\":{\"usage\":{\"input_tokens\":4,\"output_tokens\":1,...}}}",
    "gen_ai.usage.input_tokens": 4,
    "gen_ai.usage.output_tokens": 141
}
```
> Note: Cache reads also aren't included but at least they fall into `cachedInputTokens` which means they're in general `ai.usage`.

## Reproduction Steps

1. Call `streamText` with `anthropic:claude-3-5-haiku`, enable `experimental_telemetry`, use a prompt with caching enabled
2. Observe telemetry span attributes on first call (cache write)

## Reproduction Code

```typescript
import { streamText, type ModelMessage } from 'ai';
import { anthropic } from '@ai-sdk/anthropic';

async function runAnthropic(prompt: string) {
  const messages: ModelMessage[] = [
    {
      role: 'user',
      content: [
        {
          type: 'text',
          text: prompt,
          providerOptions: {
            anthropic: { cacheControl: { type: 'ephemeral' } }
          }
        }
      ]
    }
  ];

  const stream = await streamText({
    model: anthropic('claude-3-5-haiku-20241022'),
    messages,
    experimental_telemetry: { isEnabled: true }
  });

  const chunks: string[] = [];
  for await (const part of stream.textStream) {
    chunks.push(part);
  }
  const metadata = await stream.providerMetadata?.catch?.(() => undefined);
  const usage = await stream.usage?.catch?.(() => undefined);
  return { text: chunks.join(''), metadata, usage };
}

async function main() {
  if (!process.env.AI_ANTHROPIC_API_KEY && !process.env.ANTHROPIC_API_KEY) {
    console.error('Set AI_ANTHROPIC_API_KEY or ANTHROPIC_API_KEY before running this script.');
    process.exit(1);
  }


  const paragraph = 'Anthropic cache control lets us reuse large safety policies, structured response schemas, and other long-lived context while paying only for deltas.';
  const longPrompt = Array.from({ length: 60 }, (_, idx) => `Clause ${idx + 1}: ${paragraph}`).join('\n');
  const cacheBuster = `cache-buster-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
  const promptWithBuster = `${longPrompt}\nCache-Buster: ${cacheBuster}`;

  console.log(`Prompt word count ≈ ${longPrompt.split(/\s+/).length}; targeting >1024 tokens for cache eligibility.`);
  console.log('Warm-up call (fills cache)...');
  const warm = await runAnthropic(promptWithBuster);
  console.log('Warm usage (SDK):', warm.usage);
  console.log('Warm provider metadata:', warm.metadata);
  const warmUsage = (warm.metadata?.anthropic?.usage ?? {}) as Record<string, unknown>;
  const warmCreation = Number(warmUsage.cache_creation_input_tokens ?? 0);
  if (!(warmCreation > 0)) {
    throw new Error(
      `Expected Anthropic cache creation tokens > 0 on warm call, received ${warmCreation}`
    );
  }

  console.log('Second call (should reuse cache if provider supports it)...');
  const cool = await runAnthropic(promptWithBuster);
  console.log('Second usage (SDK):', cool.usage);
  console.log('Second provider metadata:', cool.metadata);
  const coolUsage = (cool.metadata?.anthropic?.usage ?? {}) as Record<string, unknown>;
  const coolRead = Number(coolUsage.cache_read_input_tokens ?? 0);
  if (!(coolRead > 0)) {
    throw new Error(
      `Expected Anthropic cache read tokens > 0 on second call, received ${coolRead}`
    );
  }
  if (Math.abs(coolRead - warmCreation) > 1e-6) {
    throw new Error(
      `Expected Anthropic cache read (${coolRead}) to match warm creation (${warmCreation})`
    );
  }
  console.log('Model output:', cool.text);
}

main().catch((err) => {
  console.error(err);
  process.exit(1);
});

```

### AI SDK Version

- "ai": "^5.0.47"
- "@ai-sdk/anthropic": "^2.0.17"

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

Labels: ai/provider, support, ai/telemetry, provider/anthropic
State: closed