Claude Opus 4.8 is Anthropic's most capable generally available model in the Opus family. It supports text, image, and file inputs with text output, featuring reasoning capabilities and a 1M-token context window. It is ideally suited for highly autonomous agents, long-horizon agentic work, knowledge work, and memory-driven tasks where coherence over extended sessions is critical. The model excels particularly at multi-step reasoning, complex coding, and end-to-end project orchestration—handling large codebases, multi-stage debugging, and long-running asynchronous agent pipelines. Beyond coding, it manages knowledge work such as drafting documents, building presentations, and analyzing data, consistently maintaining high quality across very long outputs.
Create chat completion
All API requests must be authenticated using a Bearer token in the Authorization header. Please ensure your API key is active.Authorization: Bearer sk-xxxxxx
These parameters come from the selected model form_schema. Switching models updates this list and the request example.
system_prompt?stringGlobal instructions or persona for the model.
prompt*stringtemperature?numberHigher values make output more random, lower more deterministic.
top_p?numberNucleus sampling threshold; an alternative to temperature.
max_tokens?numberstream?booleanid?stringParameter description for Id
object?stringParameter description for Object
created?integerParameter description for Created
model?stringModel ID used
choices?arrayParameter description for Choices
usage?objectParameter description for Usage
prompt_tokens?integerParameter description for Prompt Tokens
completion_tokens?integerParameter description for Completion Tokens
total_tokens?integerParameter description for Total Tokens
prompt_tokens_details?objectParameter description for Prompt Tokens Details
completion_tokens_details?objectParameter description for Completion Tokens Details
system_fingerprint?stringParameter description for System Fingerprint
error?objectParameter description for Error
message?stringError Message
type?stringError Type
param?stringRelated Parameters
code?stringError Code
error?objectParameter description for Error
message?stringError Message
type?stringError Type
param?stringRelated Parameters
code?stringError Code