---
title: "Change learning settings"
method: PATCH
path: "/api/v1/steep/learning"
tags: ["authed"]
---

# Change learning settings

`PATCH /api/v1/steep/learning`

## Request

- Base URL: `https://api.teaflask.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.teaflask.com/api/v1/steep/learning`
- Auth: none declared

Change learning's settings; only the settings present change. Turning
learning on needs a cadence and a time zone, and starts a first run at
once unless the first scheduled run is under 6 hours away. Turning it off
stops a run in progress and keeps what it found so far. The change is
saved even when the scheduler can't be reached; schedule_in_sync then
stays false until it catches up.

## Request body

- UpdateLearningSettingsRequest: A partial edit: only the settings present change. Only the spend cap takes null, which removes it; null for any other setting is refused.
  - `enabled` boolean: Turn learning on or off. Turning it on needs a cadence and a time zone; turning it off stops a run in progress.
  - `cadence` 'daily' | 'weekly' | 'monthly'
  - `timezone` string: The IANA time zone runs are timed in, like Europe/Berlin.
  - `monthly_spend_cap_microusd` integer, nullable: The most learning may spend in a calendar month (UTC), from $1.00 to $100,000.00; null removes the cap. In microusd: millionths of a US dollar (1,000,000 = $1.00).

## Response `200`

Successful Response

- LearningSettingsResponse: Learning's settings and where its schedule stands.
  - `enabled` boolean, required: Whether learning runs on its schedule.
  - `cadence` 'daily' | 'weekly' | 'monthly', required
  - `timezone` string, nullable, required: The IANA time zone runs are timed in, like Europe/Berlin. Null until learning is first turned on.
  - `monthly_spend_cap_microusd` integer, nullable, required: The most learning may spend in a calendar month (UTC), counting every learning run's cost whether your balance or your own model key pays. Null means no cap; always null for callers who can't change learning settings, since only owners see spending. In microusd: millionths of a US dollar (1,000,000 = $1.00).
  - `next_run_at` string, date-time, nullable, required: The earliest the next scheduled run starts; it starts within the hour after this time. Null while learning is off or can't run yet.
  - `schedule_in_sync` boolean, required: False while a saved change is still reaching the scheduler.
  - `first_run_pending` boolean, required: Whether the run promised when learning was turned on is still waiting to start.
  - `turned_on_at` string, date-time, nullable, required: When learning was last turned on; null until then.
  - `updated_at` string, date-time, nullable, required: When the settings last changed; null until learning is first turned on.

## Other responses

- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not found
- `405`: Method not allowed
- `422`: Validation error
- `500`: Internal server error

## Changes

- **2026-11-03** `c6ac9fd6657f`: 1 breaking, 6 info
  - removed the required property `available` from the response with the `200` status
  - removed the `STEEP_LEARNING_DISABLED` enum value from the `error/code` response property for the response status `401`
  - removed the `STEEP_LEARNING_DISABLED` enum value from the `error/code` response property for the response status `403`
  - removed the `STEEP_LEARNING_DISABLED` enum value from the `error/code` response property for the response status `404`
  - …3 more

[Operation history](https://skmtc.dev/teaflask/apis/teaflask-api/changes/api/v1/steep/learning/patch.md)

---

[API](https://skmtc.dev/teaflask/apis/teaflask-api.md) - [All operations](https://skmtc.dev/teaflask/apis/teaflask-api/llms.txt) - [OpenAPI document](https://skmtc.dev/teaflask/apis/teaflask-api/revisions/c6ac9fd6657f?raw)
