










Last updated May 28, 2026
Claude Opus 4.8 is a large language model (LLM) in Anthropic’s Claude family that supports conversational chat, tool-calling, autonomous coding, effort control, and enhanced reasoning for complex tasks with extended thinking. It offers a highly intelligent, fast, and practical solution you can use to power your AI apps. This version, claude-opus-4-8, offers better performance than the claude-opus-4-7 model.
claude-opus-4-8us, euClaude Opus 4.8 supports a variety of use cases, including advanced software development, complex agentic workflows, and enterprise operations. It’s optimized to combine maximum intelligence and capability with functional performance.
Claude Opus 4.8 follows our Claude /v1/chat/completions API schema.
To provision access to the model, attach the Managed Inference and Agents add-on to your app $APP_NAME:
heroku addons:create heroku-inference:standard -a $APP_NAME
Using config variables, you can invoke the model in various ways:
ai plugin (heroku ai:models:call)text, imagetextPrompt caching is supported for system prompts and tools. The minimum tokens required for prompt caching is 4,096.
To retrieve and export your API credentials:
export INFERENCE_KEY=$(heroku config:get -a $APP_NAME INFERENCE_KEY)
export INFERENCE_URL=$(heroku config:get -a $APP_NAME INFERENCE_URL)
curl $INFERENCE_URL/v1/chat/completions \
-H "Authorization: Bearer $INFERENCE_KEY" \
-H "Content-Type: application/json" \
-d @- <<EOF
{
"model": "claude-opus-4-8",
"messages": [
{ "role": "user", "content": "Hello!" },
{ "role": "assistant", "content": "Hi there! How can I assist you today?" },
{ "role": "user", "content": "What's the weather like in Portland, Oregon right now?" }
],
"max_tokens": 100,
"stream": false,
"tools": [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Fetches the current weather for a given city.",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. San Francisco, CA"
}
},
"required": ["location"]
}
}
}
],
"tool_choice": "auto"
}
EOF
curl -X POST "$INFERENCE_URL/v1/chat/completions" \
-H "Authorization: Bearer $INFERENCE_KEY" \
-H "Content-Type: application/json" \
-d @- <<EOF
{
"model": "claude-opus-4-8",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "What do you see in this image?"
},
{
"type": "image_url",
"image_url": {
"url": "https://upload.wikimedia.org/wikipedia/commons/thumb/e/ec/Heroku_logo.svg/960px-Heroku_logo.svg.png"
}
}
]
}
]
}
EOF
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。