opencode icon indicating copy to clipboard operation
opencode copied to clipboard

custom @ai-sdk/anthropic provider , context token usage display error

Open caozhiyuan opened this issue 5 days ago • 4 comments

Description

Image

{"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":236,"output_tokens":81,"cache_read_input_tokens":12800}}

	"provider": {
		"local": {
			"npm": "@ai-sdk/anthropic",
			"name": "My Local",
			"options": {
				"baseURL": "http://localhost:4141/v1",
				"apiKey": "dummy"
			},
			"models": {
				"gpt-5.2": {
					"name": "gpt-5.2",
					"limit": {
						"context": 200000,
						"output": 64000
					}
				},
				"gpt-5-mini": {
					"name": "gpt-5-mini",
					"limit": {
						"context": 200000,
						"output": 64000
					}
				},
				"claude-sonnet-4.5": {
					"id": "claude-sonnet-4.5",
					"name": "claude-sonnet-4.5",
					"limit": {
						"context": 200000,
						"output": 16000
					},
					"options": {
						"thinking": {
							"type": "enabled",
							"budgetTokens": 16000
						}
					}
				}
			}
		}
	}

Plugins

No response

OpenCode version

1.1.8

Steps to reproduce

  1. ask hi
  2. see context info

Screenshot and/or share link

No response

Operating System

windows 11

Terminal

pwsh

caozhiyuan avatar Jan 09 '26 13:01 caozhiyuan