# Performance

Source: https://opvs.ai/docs/api/performance

## `GET` /api/v1/factory/brand-subscriptions

**List Brand Subscriptions**

```bash
curl -X GET 'https://app.opvs.ai/api/v1/factory/brand-subscriptions' \
  -H 'Authorization: Bearer <token>'
```

```python
import httpx

resp = httpx.get(
    "https://app.opvs.ai/api/v1/factory/brand-subscriptions",
    headers={"Authorization": "Bearer <token>"},
)
resp.raise_for_status()
print(resp.json())
```

```javascript
const resp = await fetch("https://app.opvs.ai/api/v1/factory/brand-subscriptions", {
  method: "GET",
  headers: { "Authorization": "Bearer <token>" }
});
const data = await resp.json();
console.log(data);
```

```go
package main

import (
	"net/http"
)

func main() {
	req, _ := http.NewRequest("GET", "https://app.opvs.ai/api/v1/factory/brand-subscriptions", nil)
	req.Header.Set("Authorization", "Bearer <token>")
	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
}
```

**Responses**

- `200` — Successful Response

## `GET` /api/v1/factory/performance/runs

**Get Performance Runs**

Return every ledger run in the selected window, oldest first.

**Parameters**

- `window` (query, string, optional)

```bash
curl -X GET 'https://app.opvs.ai/api/v1/factory/performance/runs' \
  -H 'Authorization: Bearer <token>'
```

```python
import httpx

resp = httpx.get(
    "https://app.opvs.ai/api/v1/factory/performance/runs",
    headers={"Authorization": "Bearer <token>"},
)
resp.raise_for_status()
print(resp.json())
```

```javascript
const resp = await fetch("https://app.opvs.ai/api/v1/factory/performance/runs", {
  method: "GET",
  headers: { "Authorization": "Bearer <token>" }
});
const data = await resp.json();
console.log(data);
```

```go
package main

import (
	"net/http"
)

func main() {
	req, _ := http.NewRequest("GET", "https://app.opvs.ai/api/v1/factory/performance/runs", nil)
	req.Header.Set("Authorization", "Bearer <token>")
	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
}
```

**Responses**

- `200` — Successful Response
- `422` — Validation Error

## `GET` /api/v1/factory/performance/trend

**Get Performance Trend**

Return SQL-aggregated Trend buckets for the selected window.

**Parameters**

- `window` (query, string, optional)

```bash
curl -X GET 'https://app.opvs.ai/api/v1/factory/performance/trend' \
  -H 'Authorization: Bearer <token>'
```

```python
import httpx

resp = httpx.get(
    "https://app.opvs.ai/api/v1/factory/performance/trend",
    headers={"Authorization": "Bearer <token>"},
)
resp.raise_for_status()
print(resp.json())
```

```javascript
const resp = await fetch("https://app.opvs.ai/api/v1/factory/performance/trend", {
  method: "GET",
  headers: { "Authorization": "Bearer <token>" }
});
const data = await resp.json();
console.log(data);
```

```go
package main

import (
	"net/http"
)

func main() {
	req, _ := http.NewRequest("GET", "https://app.opvs.ai/api/v1/factory/performance/trend", nil)
	req.Header.Set("Authorization", "Bearer <token>")
	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
}
```

**Responses**

- `200` — Successful Response
- `422` — Validation Error

## `GET` /api/v1/factory/performance/subscriptions

**Get Performance Subscriptions**

**Parameters**

- `window` (query, string, optional)

```bash
curl -X GET 'https://app.opvs.ai/api/v1/factory/performance/subscriptions' \
  -H 'Authorization: Bearer <token>'
```

```python
import httpx

resp = httpx.get(
    "https://app.opvs.ai/api/v1/factory/performance/subscriptions",
    headers={"Authorization": "Bearer <token>"},
)
resp.raise_for_status()
print(resp.json())
```

```javascript
const resp = await fetch("https://app.opvs.ai/api/v1/factory/performance/subscriptions", {
  method: "GET",
  headers: { "Authorization": "Bearer <token>" }
});
const data = await resp.json();
console.log(data);
```

```go
package main

import (
	"net/http"
)

func main() {
	req, _ := http.NewRequest("GET", "https://app.opvs.ai/api/v1/factory/performance/subscriptions", nil)
	req.Header.Set("Authorization", "Bearer <token>")
	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
}
```

**Responses**

- `200` — Successful Response
- `422` — Validation Error

## `GET` /api/v1/factory/performance/subscriptions/{integration_id}/settings

**Get Subscription Settings**

**Parameters**

- `integration_id` (path, string, required)

```bash
curl -X GET 'https://app.opvs.ai/api/v1/factory/performance/subscriptions/{integration_id}/settings' \
  -H 'Authorization: Bearer <token>'
```

```python
import httpx

resp = httpx.get(
    "https://app.opvs.ai/api/v1/factory/performance/subscriptions/{integration_id}/settings",
    headers={"Authorization": "Bearer <token>"},
)
resp.raise_for_status()
print(resp.json())
```

```javascript
const resp = await fetch("https://app.opvs.ai/api/v1/factory/performance/subscriptions/{integration_id}/settings", {
  method: "GET",
  headers: { "Authorization": "Bearer <token>" }
});
const data = await resp.json();
console.log(data);
```

```go
package main

import (
	"net/http"
)

func main() {
	req, _ := http.NewRequest("GET", "https://app.opvs.ai/api/v1/factory/performance/subscriptions/{integration_id}/settings", nil)
	req.Header.Set("Authorization", "Bearer <token>")
	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
}
```

**Responses**

- `200` — Successful Response
- `422` — Validation Error

## `PUT` /api/v1/factory/performance/subscriptions/{integration_id}/settings

**Put Subscription Settings**

**Parameters**

- `integration_id` (path, string, required)

**Request body**

```bash
curl -X PUT 'https://app.opvs.ai/api/v1/factory/performance/subscriptions/{integration_id}/settings' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "price_month": 0.0,
  "currency": "string",
  "engines": [
    "string"
  ],
  "limit_pool": "string",
  "has_five_hour_limit": false,
  "alternatives": [
    {
      "name": "string",
      "price_month": 0.0,
      "multiple": 0.0
    }
  ],
  "note": "string"
}'
```

```python
import httpx

resp = httpx.put(
    "https://app.opvs.ai/api/v1/factory/performance/subscriptions/{integration_id}/settings",
    headers={"Authorization": "Bearer <token>", "Content-Type": "application/json"},
    json={"price_month": 0.0, "currency": "string", "engines": ["string"], "limit_pool": "string", "has_five_hour_limit": false, "alternatives": [{"name": "string", "price_month": 0.0, "multiple": 0.0}], "note": "string"},
)
resp.raise_for_status()
print(resp.json())
```

```javascript
const resp = await fetch("https://app.opvs.ai/api/v1/factory/performance/subscriptions/{integration_id}/settings", {
  method: "PUT",
  headers: { "Authorization": "Bearer <token>", "Content-Type": "application/json" },
  body: JSON.stringify({"price_month": 0.0, "currency": "string", "engines": ["string"], "limit_pool": "string", "has_five_hour_limit": false, "alternatives": [{"name": "string", "price_month": 0.0, "multiple": 0.0}], "note": "string"})
});
const data = await resp.json();
console.log(data);
```

```go
package main

import (
	"net/http"
	"strings"
)

func main() {
	body := strings.NewReader(`{"price_month": 0.0, "currency": "string", "engines": ["string"], "limit_pool": "string", "has_five_hour_limit": false, "alternatives": [{"name": "string", "price_month": 0.0, "multiple": 0.0}], "note": "string"}`)
	req, _ := http.NewRequest("PUT", "https://app.opvs.ai/api/v1/factory/performance/subscriptions/{integration_id}/settings", body)
	req.Header.Set("Authorization", "Bearer <token>")
	req.Header.Set("Content-Type", "application/json")
	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
}
```

**Responses**

- `200` — Successful Response
- `422` — Validation Error

## `GET` /api/v1/factory/performance/subscriptions/{integration_id}/readings

**List Subscription Readings**

**Parameters**

- `integration_id` (path, string, required)
- `limit` (query, integer, optional)

```bash
curl -X GET 'https://app.opvs.ai/api/v1/factory/performance/subscriptions/{integration_id}/readings' \
  -H 'Authorization: Bearer <token>'
```

```python
import httpx

resp = httpx.get(
    "https://app.opvs.ai/api/v1/factory/performance/subscriptions/{integration_id}/readings",
    headers={"Authorization": "Bearer <token>"},
)
resp.raise_for_status()
print(resp.json())
```

```javascript
const resp = await fetch("https://app.opvs.ai/api/v1/factory/performance/subscriptions/{integration_id}/readings", {
  method: "GET",
  headers: { "Authorization": "Bearer <token>" }
});
const data = await resp.json();
console.log(data);
```

```go
package main

import (
	"net/http"
)

func main() {
	req, _ := http.NewRequest("GET", "https://app.opvs.ai/api/v1/factory/performance/subscriptions/{integration_id}/readings", nil)
	req.Header.Set("Authorization", "Bearer <token>")
	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
}
```

**Responses**

- `200` — Successful Response
- `422` — Validation Error

## `POST` /api/v1/factory/performance/subscriptions/{integration_id}/readings

**Create Subscription Reading**

**Parameters**

- `integration_id` (path, string, required)

**Request body**

```bash
curl -X POST 'https://app.opvs.ai/api/v1/factory/performance/subscriptions/{integration_id}/readings' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "read_at": "2026-01-01T00:00:00Z",
  "week_used_pct": 0.0,
  "week_resets_at": "2026-01-01T00:00:00Z",
  "five_hour_used_pct": 0.0,
  "five_hour_resets_at": "2026-01-01T00:00:00Z",
  "engine_split": {},
  "credits_left": "string",
  "source": "owner",
  "note": "string"
}'
```

```python
import httpx

resp = httpx.post(
    "https://app.opvs.ai/api/v1/factory/performance/subscriptions/{integration_id}/readings",
    headers={"Authorization": "Bearer <token>", "Content-Type": "application/json"},
    json={"read_at": "2026-01-01T00:00:00Z", "week_used_pct": 0.0, "week_resets_at": "2026-01-01T00:00:00Z", "five_hour_used_pct": 0.0, "five_hour_resets_at": "2026-01-01T00:00:00Z", "engine_split": {}, "credits_left": "string", "source": "owner", "note": "string"},
)
resp.raise_for_status()
print(resp.json())
```

```javascript
const resp = await fetch("https://app.opvs.ai/api/v1/factory/performance/subscriptions/{integration_id}/readings", {
  method: "POST",
  headers: { "Authorization": "Bearer <token>", "Content-Type": "application/json" },
  body: JSON.stringify({"read_at": "2026-01-01T00:00:00Z", "week_used_pct": 0.0, "week_resets_at": "2026-01-01T00:00:00Z", "five_hour_used_pct": 0.0, "five_hour_resets_at": "2026-01-01T00:00:00Z", "engine_split": {}, "credits_left": "string", "source": "owner", "note": "string"})
});
const data = await resp.json();
console.log(data);
```

```go
package main

import (
	"net/http"
	"strings"
)

func main() {
	body := strings.NewReader(`{"read_at": "2026-01-01T00:00:00Z", "week_used_pct": 0.0, "week_resets_at": "2026-01-01T00:00:00Z", "five_hour_used_pct": 0.0, "five_hour_resets_at": "2026-01-01T00:00:00Z", "engine_split": {}, "credits_left": "string", "source": "owner", "note": "string"}`)
	req, _ := http.NewRequest("POST", "https://app.opvs.ai/api/v1/factory/performance/subscriptions/{integration_id}/readings", body)
	req.Header.Set("Authorization", "Bearer <token>")
	req.Header.Set("Content-Type", "application/json")
	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
}
```

**Responses**

- `201` — Successful Response
- `422` — Validation Error

## `GET` /api/v1/factory/performance/routing

**Get Performance Routing**

**Parameters**

- `task_type` (query, string, optional)
- `window` (query, string, optional)

```bash
curl -X GET 'https://app.opvs.ai/api/v1/factory/performance/routing' \
  -H 'Authorization: Bearer <token>'
```

```python
import httpx

resp = httpx.get(
    "https://app.opvs.ai/api/v1/factory/performance/routing",
    headers={"Authorization": "Bearer <token>"},
)
resp.raise_for_status()
print(resp.json())
```

```javascript
const resp = await fetch("https://app.opvs.ai/api/v1/factory/performance/routing", {
  method: "GET",
  headers: { "Authorization": "Bearer <token>" }
});
const data = await resp.json();
console.log(data);
```

```go
package main

import (
	"net/http"
)

func main() {
	req, _ := http.NewRequest("GET", "https://app.opvs.ai/api/v1/factory/performance/routing", nil)
	req.Header.Set("Authorization", "Bearer <token>")
	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
}
```

**Responses**

- `200` — Successful Response
- `422` — Validation Error

## `GET` /api/v1/factory/performance/costs

**Get Performance Costs**

**Parameters**

- `window` (query, string, optional)

```bash
curl -X GET 'https://app.opvs.ai/api/v1/factory/performance/costs' \
  -H 'Authorization: Bearer <token>'
```

```python
import httpx

resp = httpx.get(
    "https://app.opvs.ai/api/v1/factory/performance/costs",
    headers={"Authorization": "Bearer <token>"},
)
resp.raise_for_status()
print(resp.json())
```

```javascript
const resp = await fetch("https://app.opvs.ai/api/v1/factory/performance/costs", {
  method: "GET",
  headers: { "Authorization": "Bearer <token>" }
});
const data = await resp.json();
console.log(data);
```

```go
package main

import (
	"net/http"
)

func main() {
	req, _ := http.NewRequest("GET", "https://app.opvs.ai/api/v1/factory/performance/costs", nil)
	req.Header.Set("Authorization", "Bearer <token>")
	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
}
```

**Responses**

- `200` — Successful Response
- `422` — Validation Error

## List Brand Subscriptions

`GET https://app.opvs.ai/api/v1/factory/brand-subscriptions`

Also as: MCP `tool_call software-factory.listBrandSubscriptions` · skill `software-factory`

## Get Performance Runs

`GET https://app.opvs.ai/api/v1/factory/performance/runs`

Also as: MCP `tool_call software-factory.getPerformanceRuns` · skill `software-factory`

Return every ledger run in the selected window, oldest first.

| Code | When | What to do |
| --- | --- | --- |
| 422 | Validation Error |  |

## Get Performance Trend

`GET https://app.opvs.ai/api/v1/factory/performance/trend`

Also as: MCP `tool_call software-factory.getPerformanceTrend` · skill `software-factory`

Return SQL-aggregated Trend buckets for the selected window.

| Code | When | What to do |
| --- | --- | --- |
| 422 | Validation Error |  |

## Get Performance Subscriptions

`GET https://app.opvs.ai/api/v1/factory/performance/subscriptions`

Also as: MCP `tool_call software-factory.getPerformanceSubscriptions` · skill `software-factory`

| Code | When | What to do |
| --- | --- | --- |
| 422 | Validation Error |  |

## Get Subscription Settings

`GET https://app.opvs.ai/api/v1/factory/performance/subscriptions/{integration_id}/settings`

Also as: MCP `tool_call software-factory.getSubscriptionSettings` · skill `software-factory`

| Code | When | What to do |
| --- | --- | --- |
| 422 | Validation Error |  |

## Put Subscription Settings

`PUT https://app.opvs.ai/api/v1/factory/performance/subscriptions/{integration_id}/settings`

Also as: MCP `tool_call software-factory.setSubscriptionSettings` · skill `software-factory`

| Code | When | What to do |
| --- | --- | --- |
| 422 | Validation Error |  |

## List Subscription Readings

`GET https://app.opvs.ai/api/v1/factory/performance/subscriptions/{integration_id}/readings`

Also as: MCP `tool_call software-factory.listSubscriptionReadings` · skill `software-factory`

| Code | When | What to do |
| --- | --- | --- |
| 422 | Validation Error |  |

## Create Subscription Reading

`POST https://app.opvs.ai/api/v1/factory/performance/subscriptions/{integration_id}/readings`

Also as: MCP `tool_call software-factory.createSubscriptionReading` · skill `software-factory`

| Code | When | What to do |
| --- | --- | --- |
| 422 | Validation Error |  |

## Get Performance Routing

`GET https://app.opvs.ai/api/v1/factory/performance/routing`

Also as: MCP `tool_call software-factory.getPerformanceRouting` · skill `software-factory`

| Code | When | What to do |
| --- | --- | --- |
| 422 | Validation Error |  |

## Get Performance Costs

`GET https://app.opvs.ai/api/v1/factory/performance/costs`

Also as: MCP `tool_call software-factory.getPerformanceCosts` · skill `software-factory`

| Code | When | What to do |
| --- | --- | --- |
| 422 | Validation Error |  |
