Model Studio records audit logs by default; you can enable inference logs to record the complete Prompt and Response, and deliver logs to a Simple Log Service (SLS) Logstore. You can also pass a custom request header to associate business requests with model calls in audit logs.
Model Studio records audit logs by default (stored on the platform, no configuration required), capturing the request information of each model call but not the Prompt or Response. Inference logs record the complete Prompt and Response and the intermediate steps; they must be enabled manually and rely on log delivery to write logs to your own Simple Log Service (SLS) Logstore.
Audit logs are enabled by default for all users, require no configuration, and are stored on the Model Studio platform. Audit logs record the request information of each model call, including core metrics such as Request ID, time, model, token usage, latency, and status, but do not include the Prompt and Response content. To view the complete Prompt and Response content, enable inference logs (for how to enable them, see the Inference log section).
Audit logs are retained for 30 days on the Model Studio platform by default.
Log on to the Model Studio console, and in the left-side navigation pane choose Operations > Model Logs to open the Audit Log tab. To retain logs longer, enable log delivery to deliver audit logs to a Logstore under your own Simple Log Service (SLS) account, and then adjust the log retention period in SLS (to adjust the retention period, see Manage a Logstore; for how to enable delivery, see the Log delivery section).
Audit logs support the following filter conditions:
The audit log list displays the following fields: Request ID, call time, model, usage, first-token latency, call duration, status, API Key, and error code. The Actions column provides Details, which opens the audit log details side panel.
The audit log details side panel supports switching between the List and JSON tabs. The List tab shows the following groups:
The JSON view of the audit log details side panel uses the same fields as the logs delivered to SLS. The 25 fields are described below by category (only the first 2 rows are shown by default; click Expand all fields to view the complete list).
Inference logs must be enabled manually. On top of audit logs, inference logs additionally record the complete Prompt and Response and the intermediate steps, which help with debugging, optimization, and troubleshooting. Inference logs are stored in your own Simple Log Service (SLS) Logstore.
Inference logs are disabled by default; you must first enable audit log delivery. On the log page, switch to the Inference Log tab (when it is not configured, this tab shows a guide page to enable it) and click Start configuration to open the log delivery configuration dialog box. You can also enter it by clicking the Log delivery configuration button in the upper-right corner of the log page. After you complete the authorization and Logstore configuration, you can view the inference log list.
The filter conditions for inference logs are the same as for audit logs. For models that do not support inference logs, "Not supported by the current model" is displayed.
On top of audit logs, the inference log list adds a "Requests and responses" column that shows the Prompt and Response data. Each log entry is limited to 128K in length; content beyond the limit is truncated. For the complete content, view the logs in the SLS Logstore you delivered to.
Inference logs can be recycled into training datasets: click the Log backflow button on the Inference Log tab. For more information, see Log backflow.
By default, Model Studio stores audit logs on the platform, so you can view them in the console without any delivery. To retain logs long term or integrate them with your own O&M systems, enable log delivery, which automatically delivers audit logs and inference logs to a Logstore of the Simple Log Service (SLS) under your account. Log delivery is also a prerequisite for enabling inference logs.
The log delivery configuration entry is in the upper-right corner of the log page (to open the log page, choose Operations > Model Logs in the left-side navigation pane).
Configuring log delivery for the first time requires the following three steps:
After you enable or disable audit log delivery, a result message briefly pops up at the top of the page. The authorization and configuration process is the same as the delivery configuration steps.
Before you enable inference log delivery, you must first enable audit log delivery (inference log delivery cannot be enabled when audit log delivery is not configured). The authorization and configuration process for inference log delivery is the same as the delivery configuration steps.
After the configuration is complete, a status indicator is displayed next to the log delivery configuration; the three states have the same meanings as for monitoring data delivery.
When troubleshooting business issues, you may need to confirm which model calls were triggered by a specific order or business request. When calling a model, you can pass a custom business identifier (such as an order identifier, business request ID, or trace ID) in the
If no call record is found, check the following:
To pass multiple fields such as a business request ID and a business scenario, serialize the fields into a compact JSON string and pass it as the value of the request header. The following example reuses the
Verify the audit log as described earlier; the
Audit log
Audit logs are enabled by default for all users, require no configuration, and are stored on the Model Studio platform. Audit logs record the request information of each model call, including core metrics such as Request ID, time, model, token usage, latency, and status, but do not include the Prompt and Response content. To view the complete Prompt and Response content, enable inference logs (for how to enable them, see the Inference log section).
Audit logs are retained for 30 days on the Model Studio platform by default.
Log on to the Model Studio console, and in the left-side navigation pane choose Operations > Model Logs to open the Audit Log tab. To retain logs longer, enable log delivery to deliver audit logs to a Logstore under your own Simple Log Service (SLS) account, and then adjust the log retention period in SLS (to adjust the retention period, see Manage a Logstore; for how to enable delivery, see the Log delivery section).
Filter conditions
Audit logs support the following filter conditions:
- Time range: 24 hours by default; supports 3/6/12/24 hours, today, and custom time ranges, and custom ranges can query logs from up to 30 days back.
- Model: Drop-down selection; all models by default.
- API key ID: Drop-down selection. The API key shows the ID and description; if the API key is deleted, the description is empty.
- Status: Multiple selection, including 0 (request succeeded but the user actively interrupted it), 200 (Success), 4XX (exceptions caused by user behavior), and 5XX (service unavailable).
- Inference type: Online inference by default.
- Search Request ID: Exact match.
Log list
The audit log list displays the following fields: Request ID, call time, model, usage, first-token latency, call duration, status, API Key, and error code. The Actions column provides Details, which opens the audit log details side panel.

Details side panel
The audit log details side panel supports switching between the List and JSON tabs. The List tab shows the following groups:
- Basic information: Request ID, creation time, model, API Key
- Usage: total tokens, output tokens, input tokens
- Performance: first-token latency, total duration, status code
extras extension fields (business identifiers are recorded there; see Custom business identifier best practices); the meaning of each field is described in Field reference.
To create and manage API keys, see Obtain an API key.
Field reference
The JSON view of the audit log details side panel uses the same fields as the logs delivered to SLS. The 25 fields are described below by category (only the first 2 rows are shown by default; click Expand all fields to view the complete list).
| Category | Field | Type | Description |
|---|---|---|---|
| Request basics | request_id | string | Unique ID (UUID) generated by the system for the model call, used to locate and trace the call; corresponds to the Request ID column |
| Request basics | start_time | string | When the call started (Beijing time, to the millisecond); corresponds to the call time column |
| Request basics | start_unix_timestamp | string | Unix timestamp (milliseconds) of when the call started |
| Request basics | duration | string | Total time from request to response, in milliseconds; corresponds to the call duration column |
| Request basics | first_output_duration | string | First-token latency (delay before the first output token), in milliseconds; shown only in records of streaming calls; corresponds to the first-token latency column |
| Request basics | status_code | string | Status code of the call: 0 (request succeeded but actively interrupted by the user), 200 (success), 4XX (exceptions caused by user behavior), 5XX (service unavailable); corresponds to the status column |
| Request basics | error_code | string | Error code of the failed call, shown only in failed records; corresponds to the error code column |
| Request basics | error_message | string | Error message of the failed call, shown only in failed records |
| Model and source | model | string | Model code; corresponds to the model column |
| Model and source | source | string | Log source (model indicates a model call) |
| Model and source | channel | string | Call channel (default indicates the default channel) |
| Model and source | region | string | Region of the call, such as cn-beijing |
| Token usage | usage.total_tokens | int | Total tokens consumed by the call, corresponding to the usage column |
| Token usage | usage.input_tokens | int | Input tokens |
| Token usage | usage.output_tokens | int | Output tokens |
| Token usage | usage.prompt_tokens_details.cached_tokens | int | Number of input tokens served from the context cache |
| Authentication and client | apikey_id | string | ID of the API key used for the call, corresponding to the API Key column; after an API key is deleted, the list does not show the description and the details show only the ID |
| Authentication and client | uid | string | Alibaba Cloud account ID that made the call |
| Authentication and client | client_ip | string | Client IP that made the call |
| Authentication and client | workspace_id | string | Workspace from which the call was made |
| Extension | extras.custom_data | string | Custom business identifier (see Custom business identifier best practices) |
| Extension | extras.encrypt | string | Encryption status |
| Extension | extras.model_type | string | Model type |
| Extension | extras.protocol | string | Call protocol: HTTP (non-streaming), SSE (streaming) |
| Extension | extras.sub_protocol | string | Call sub-protocol |
Inference log
Inference logs must be enabled manually. On top of audit logs, inference logs additionally record the complete Prompt and Response and the intermediate steps, which help with debugging, optimization, and troubleshooting. Inference logs are stored in your own Simple Log Service (SLS) Logstore.
Enable inference logs
Inference logs are disabled by default; you must first enable audit log delivery. On the log page, switch to the Inference Log tab (when it is not configured, this tab shows a guide page to enable it) and click Start configuration to open the log delivery configuration dialog box. You can also enter it by clicking the Log delivery configuration button in the upper-right corner of the log page. After you complete the authorization and Logstore configuration, you can view the inference log list.
Inference logs are currently supported only in the Beijing and Singapore regions; other regions are not yet supported.
Log list and details
The filter conditions for inference logs are the same as for audit logs. For models that do not support inference logs, "Not supported by the current model" is displayed.
On top of audit logs, the inference log list adds a "Requests and responses" column that shows the Prompt and Response data. Each log entry is limited to 128K in length; content beyond the limit is truncated. For the complete content, view the logs in the SLS Logstore you delivered to.

Log delivery
By default, Model Studio stores audit logs on the platform, so you can view them in the console without any delivery. To retain logs long term or integrate them with your own O&M systems, enable log delivery, which automatically delivers audit logs and inference logs to a Logstore of the Simple Log Service (SLS) under your account. Log delivery is also a prerequisite for enabling inference logs.
Enabling inference logs and delivering logs to your own SLS Logstore incurs Simple Log Service charges.
Delivery configuration steps
The log delivery configuration entry is in the upper-right corner of the log page (to open the log page, choose Operations > Model Logs in the left-side navigation pane).
Configuring log delivery for the first time requires the following three steps:
- Authorize the Simple Log Service role.
- Activate Simple Log Service.
- Create a Logstore.
Audit log delivery
After you enable or disable audit log delivery, a result message briefly pops up at the top of the page. The authorization and configuration process is the same as the delivery configuration steps.
Inference log delivery
Before you enable inference log delivery, you must first enable audit log delivery (inference log delivery cannot be enabled when audit log delivery is not configured). The authorization and configuration process for inference log delivery is the same as the delivery configuration steps.
After the configuration is complete, a status indicator is displayed next to the log delivery configuration; the three states have the same meanings as for monitoring data delivery.
Custom business identifier best practices
When troubleshooting business issues, you may need to confirm which model calls were triggered by a specific order or business request. When calling a model, you can pass a custom business identifier (such as an order identifier, business request ID, or trace ID) in the X-DashScope-Custom-Data request header. The identifier is written as-is into the extras.custom_data field of the audit log for that call, associating business requests with model calls.
When the same business request triggers multiple model calls, you can reuse the same business identifier and record the Request ID of each call separately in your business logs. Business identifiers are shown only in the JSON view of the audit log details, and filtering by business identifier is not supported. When troubleshooting, first obtain the Request ID from the business logs, then locate the call in the audit logs and verify the business identifier (see Verify the audit log).
Currently, this request header is supported in calls to the OpenAI-compatible Chat API (including streaming calls) and the Model Studio native API (the
/api/v1/services/ path). The OpenAI-compatible Responses API and the Anthropic-compatible Messages API are not yet supported.Pass a business identifier
- Select an identifier to associate with your business logs. This topic uses the order identifier
order-20261028-001as an example. - Write the identifier into the
X-DashScope-Custom-Datarequest header and make the model call. Replace{WorkspaceId}with your workspace ID. If you call from another region, use the endpoint of that region (see OpenAI compatible - Chat).
- cURL
- OpenAI Python SDK
Verify the audit log
- After the model call completes, record the Request ID from the response (for OpenAI-compatible APIs, the response body
idfield and thex-request-idresponse header return the same value; for the native API, the response bodyrequest_idfield). - Log on to the Model Studio console, select the region and workspace used for the call, and in the left-side navigation pane choose Operations > Model Logs. On the Audit Log tab, select a time range that covers the call time, and use the Request ID (exact match) to locate the record.
- Click Details on the record, switch to the JSON tab in the audit log details side panel, and check the
extras.custom_datafield. In this example, the value isorder-20261028-001. The following shows only theextrasfields related to this feature:

- Whether the region, workspace, query time range, and Request ID match those used for the call.
- Whether the call was rejected at the authentication layer (for example, an invalid API key) — calls rejected at the authentication layer do not generate audit logs.
custom_data field, check whether the request actually sent to Model Studio carried this request header, and whether the gateways or proxies the request passed through forwarded it intact (see Usage limits and notes).
Pass multiple business fields (optional)
To pass multiple fields such as a business request ID and a business scenario, serialize the fields into a compact JSON string and pass it as the value of the request header. The following example reuses the client created earlier:
extras snippet is as follows:
custom_data is always a string in the audit log, not a nested JSON object. After parsing extras, you can use json.loads(extras["custom_data"]) to parse the business fields. Before sending, confirm that the serialized string is within the length limit specified in the Usage limits and notes; otherwise, truncation may make the JSON unparseable.
Usage limits and notes
- Audit logs retain at most the first 512 characters of the request header value; the excess is truncated.
- Use ASCII characters for the request header value: HTTP clients and proxies generally do not support non-ASCII header values, and the request fails at the sending stage. When passing multiple fields, use JSON serialization with
ensure_ascii=True. - The request header name is case-insensitive; use
X-DashScope-Custom-Dataconsistently. - If the model request passes through a business service, API gateway, or other proxy, make sure the intermediate layers forward this request header intact to Model Studio.
- The business identifier is for business association only and does not change how the system Request ID is generated or queried.