Перейти к содержимому
На главную

SeaCloud Model API

Это содержимое пока не доступно на вашем языке.

Model API provides different invocation protocols for different model types. Multimodal models usually use an asynchronous task protocol: create a task, poll its status, and retrieve the result. Large language models usually use synchronous or streaming protocols, returning text or incremental output within a single request.

SeaCloud LLM API is for Chat Completions, Anthropic Messages, and Responses API calls. Public endpoints use the unified /llm prefix, and the platform handles API Key authentication, balance checks, and request tracing.

Terminal window
export BASE_URL="https://cloud.seaart.ai/llm"
export API_KEY="YOUR_API_KEY"
curl -sS "${BASE_URL}/v1/chat/completions" \
-H "Authorization: Bearer ${API_KEY}" \
-H "Content-Type: application/json" \
-H "X-Request-Id: demo-$(date +%s)" \
-d '{
"model": "gpt-4.1",
"messages": [
{
"role": "user",
"content": "Introduce SeaCloud LLM API in one sentence"
}
],
"temperature": 0.7
}'

Multimodal models use an asynchronous queue protocol: create a task, poll its status, and retrieve the result after completion. To stop execution, send a cancellation request. The endpoint in the URL directly uses the SeaCloud model ID, and the request body directly passes the model parameter object.

Terminal window
export BASE_URL="https://cloud.seaart.ai/model"
export ENDPOINT="nano_banana_2"
export API_KEY="YOUR_API_KEY"
COMMON_HEADERS=(
-H "Authorization: Key ${API_KEY}"
-H "Content-Type: application/json"
)
SUBMIT_RESPONSE="$(curl -sS -X POST "${BASE_URL}/v1/queue/${ENDPOINT}" \
"${COMMON_HEADERS[@]}" \
-d '{
"prompt": "a cinematic photo of a cat astronaut"
}')"
echo "${SUBMIT_RESPONSE}" | jq .
REQUEST_ID="$(echo "${SUBMIT_RESPONSE}" | jq -r '.request_id')"
STATUS_URL="$(echo "${SUBMIT_RESPONSE}" | jq -r '.status_url')"
RESPONSE_URL="$(echo "${SUBMIT_RESPONSE}" | jq -r '.response_url')"
while true; do
STATUS_RESPONSE="$(curl -sS "${STATUS_URL}" "${COMMON_HEADERS[@]}")"
echo "${STATUS_RESPONSE}" | jq .
STATUS="$(echo "${STATUS_RESPONSE}" | jq -r '.status')"
ERROR="$(echo "${STATUS_RESPONSE}" | jq -r '.error // empty')"
if [ "${STATUS}" = "COMPLETED" ]; then
if [ -n "${ERROR}" ]; then
echo "task failed: ${ERROR}"
exit 1
fi
break
fi
sleep 3
done
curl -sS "${RESPONSE_URL}" "${COMMON_HEADERS[@]}" | jq .