MaaS_Cl_Opus_4.8/5
Claude-opus-4.8
Basic Information
-
URL: https:// genaiapi.cloudsway.net
-
API Request Endpoint:
POST -
Authentication : Authentication is performed via HTTP Bearer Token, and the API key needs to be included in the request header.
| Parameter Name | Type | Required | Description |
|---|---|---|---|
Content-Type |
string | is | Fixed to application/json |
Authorization |
string | is | Bearer {your_api_key} |
Explanation of Core Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model |
string | is | Model ID to be used |
messages |
array | is | Conversation message list, includingrole (user or assistant) and content |
max_t okens |
integer | is | Maximum number of tokens generated |
system |
string | No | System prompt, used to set the behavior and background of the assistant |
temperature |
number | No | Sampling temperature, where a higher value makes the output more random and a lower value makes it more deterministic, only supports a fixed value of 1 |
top_p |
number | No | Nucleus sampling parameter, the model considers the results of tokens with top_p probability mass, only supports passing a fixed value of 0.99 |
top_k |
integer | No | Only sample from the K tokens with the highest probability in each step, opus 4.8 does not support this |
stream |
boolean | No | Whether to enable streaming, default isfalse |
stop_sequences |
array | No | Custom stop sequences, which stop the model when generated |
Request and Response Examples
Endpoint calls /v1/messages
curl --location --request POST 'https://genaiapi.cloudsway.net/{ENDPOINT}/v1/messages' \
--header 'Authorization: Bearer {Your AK}' \
--header 'Content-Type: application/json' \
--data-raw '{
"max_tokens": 2048,
"stream": false,
"messages": [
{
"role": "user",
"content": "Prove the Pythagorean theorem"
}
],
"thinking": {
"type": "adaptive"
}
}'
OpenAI Endpoint Call /chat/completions
curl --location --request POST 'https://genaiapi.cloudsway.net/v1/ai/{ENDPOINT}/chat/completions' \
--header 'Authorization: Bearer {Your AK}' \
--header 'Content-Type: application/json' \
--data-raw '{
"max_tokens": 2048,
"stream": false,
"messages": [
{
"role": "user",
"content": "Prove the Pythagorean theorem"
}
],
"thinking": {
"type": "adaptive"
}
}'
Unified domain name calls chat/completions
curl --location --request POST 'https://genaiapi.cloudsway.net/v1/chat/completions' \
--header 'Authorization: Bearer {Your AK}' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "MaaS_Cl_Opus_4.8_20260528",
"stream": false,
"messages": [
{
"role": "user",
"content": "who are you"
}
],
"thinking": {
"type": "adaptive"
}
}'
Function Introduction
thinking
opus4.8 does not support extended thinking budget, and passing the following parameters will result in a 400 error
opus4.8 only supports the Adaptive mode
Minimum cached token
The minimum cacheable prompt length on Claude Opus 4.8 is 1024 tokens, and no code changes are required.
Introduction to Claude-opus-5 Features
Mid-conversation Tool Change (Beta)
The request header must carry: mid-conversation-tool-changes-2026-07-01to dynamically add and remove tools between multiple conversation rounds while retaining the prompt cache.
{
"model": "claude-opus-5",
"max_tokens": 1024,
"cache_control": {"type": "ephemeral"},
"system": "You are a code review assistant. Be concise.",
"messages": [
{
"role": "user",
"content": "Review process() in utils.py for performance issues."
},
{
"role": "assistant",
"content": "The list comprehension is fine for small inputs. For large inputs, consider a generator to avoid materializing the full list."
},
{
"role": "user",
"content": "Now review the calling code that invokes process()."
},
{
"role": "system",
"content": "From now on, every suggestion must include explicit type annotations."
}
]
}'
Thinking mode is enabled by default
Passing in thinking: {"type": "adaptive"} is equivalent to not passing it at all, and the thinking content will be included in the response content in both cases.
Prompt cache threshold lowered
Minimum cache tokens: 512 (1024 for Opus 4.8), short prompts can be cached directly without modifying business code.
Disabling thinking requires effort to be highor lower
(The default value is high; if no effort parameter is passed, it also defaults to high.) On Claude Opus 5, only when the effort level is highor lower will the parameter thinking: {"type": "disabled"}be accepted. Setting xhighor maxeffort while including thinking: {"type": "disabled"}will result in a 400 error.This is a behavior that has been officially available starting from Claude Opus 5, and it is enforced on every request.