> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.mixlayer.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.mixlayer.com/_mcp/server.

# Get an inference sequence

GET https://api.mixlayer.com/v1/organizations/{org_id}/analytics/sequences/{seq_id}

When authenticated with an API key, this operation requires `api-read`.

Reference: https://docs.mixlayer.com/api-reference/platform-api/analytics/get-sequence-by-id

## Authentication

- `Authorization` header (bearer token, required) — Console user session or Mixlayer API key supplied as a Bearer token.

## Request

### Path parameters

- `org_id` (string, required) — Organization ID
- `seq_id` (string, required) — Sequence ID

### Query parameters

- `range_start` (long, optional) — Inclusive Unix timestamp in milliseconds.
- `range_end` (long, optional) — Exclusive Unix timestamp in milliseconds.

## Response

### 200

Inference sequence

- `data` (ApiDataResponseSequenceResponseData, required) — Response envelope for one inference sequence.

## Errors

### 400 Bad Request Error

Query parameters are missing or invalid.

- `error` (ApiErrorBody, required) — Structured error details.

### 401 Unauthorized Error

Authentication is missing or invalid.

- `error` (ApiErrorBody, required) — Structured error details.

### 403 Forbidden Error

The authenticated principal cannot perform this operation.

- `error` (ApiErrorBody, required) — Structured error details.

### 404 Not Found Error

Sequence not found

- `error` (ApiErrorBody, required) — Structured error details.

### 500 Internal Server Error

An unexpected server or database error occurred.

- `error` (ApiErrorBody, required) — Structured error details.

### 503 Service Unavailable Error

Analytics is not configured

- `error` (ApiErrorBody, required) — Structured error details.

## Types

### ApiDataResponseSequenceResponseData

Response envelope for one inference sequence.

- `sequence` (Sequence, required) — Matching inference sequence.

### ApiErrorBody

Structured error details returned by the platform API.

- `message` (string, required) — Human-readable error message.
- `code` (string, optional, nullable) — Stable machine-readable error code, when available.
- `details` (any, optional) — Error-specific structured context, when available.

### Sequence

API-facing sequence shape. `org_id`, `event_id`, `version`, `gateway_instance`, and `ingest_ts` are intentionally omitted.

- `cached_input_tokens` (long, required) — Number of cached input tokens.
- `call_source` (string, required) — API surface that initiated the request, such as chat completions.
- `gateway_latency_ms` (long, required) — Gateway processing latency in milliseconds.
- `input_tokens` (long, required) — Number of non-cached input tokens.
- `model` (string, required) — Model SKU used by the request.
- `output_tokens` (long, required) — Number of generated output tokens.
- `result` (string, required) — Request result, such as `success` or `error`.
- `seq_duration_ms` (long, required) — Total sequence duration in milliseconds.
- `seq_id` (string, required) — Stable identifier for the inference request sequence.
- `timestamp` (long, required) — Sequence start time as Unix milliseconds.
- `tool_calls` (list of string, required) — Tool names called during the request.
- `api_key_id` (string, optional, nullable) — API key identifier used by the request, when available.
- `client_ip` (string, optional, nullable) — Client IP address, when recorded.
- `client_ua` (string, optional, nullable) — Client user-agent string, when recorded.
- `error_code` (string, optional, nullable) — Machine-readable error code for a failed request.
- `error_message` (string, optional, nullable) — Recorded error message for a failed request.

## Examples

**Response**

```json
{
  "data": {
    "sequence": {
      "cached_input_tokens": 1,
      "call_source": "string",
      "gateway_latency_ms": 1,
      "input_tokens": 1,
      "model": "string",
      "output_tokens": 1,
      "result": "string",
      "seq_duration_ms": 1,
      "seq_id": "string",
      "timestamp": 1,
      "tool_calls": [
        "string"
      ],
      "api_key_id": "string",
      "client_ip": "string",
      "client_ua": "string",
      "error_code": "string",
      "error_message": "string"
    }
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.mixlayer.com/v1/organizations/org_id/analytics/sequences/seq_id"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.mixlayer.com/v1/organizations/org_id/analytics/sequences/seq_id';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.mixlayer.com/v1/organizations/org_id/analytics/sequences/seq_id"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.mixlayer.com/v1/organizations/org_id/analytics/sequences/seq_id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.mixlayer.com/v1/organizations/org_id/analytics/sequences/seq_id")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.mixlayer.com/v1/organizations/org_id/analytics/sequences/seq_id', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```