> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Start Training

> Start a new training job with the specified configuration.

Start a new training job with the specified configuration.

### Request body

`TrainingRequest`

<ParamField body="agent_config" type="AgentConfigRequest" required />

<ParamField body="environment_scenarios" type="object[]" required>
  Training scenarios
</ParamField>

<ParamField body="reward_config" type="object" required>
  Reward function configuration
</ParamField>

<ParamField body="num_episodes" type="integer">
  Number of training episodes
</ParamField>

<ParamField body="profile" type="string">
  Training profile
</ParamField>

<ParamField body="resume_from_checkpoint" type="string,null">
  Checkpoint path to resume training from
</ParamField>

<ParamField body="training_config_overrides" type="object,null">
  Optional training configuration overrides
</ParamField>

### Response

`TrainingResponse`

<ResponseField name="training_id" type="string" required>
  Training job identifier
</ResponseField>

<ResponseField name="status" type="string" required>
  Training status
</ResponseField>

<ResponseField name="estimated_time" type="number,null">
  Estimated completion time
</ResponseField>

<ResponseField name="message" type="string" required>
  Status message
</ResponseField>

### Status codes

| Code  | Meaning                       |
| ----- | ----------------------------- |
| `200` | Successful response           |
| `202` | Training started successfully |
| `400` | Invalid configuration         |
| `401` | Authentication required       |
| `403` | Insufficient permissions      |
| `422` | Validation Error              |
| `429` | Rate limit exceeded           |
| `500` | Internal server error         |

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'http://localhost:8000/training' \
    --header 'Authorization: Bearer YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
    "agent_config": {
      "enable_planning": false,
      "max_new_tokens": 256,
      "model_name": "gpt2",
      "temperature": 0.7
    },
    "environment_scenarios": [
      {
        "id": "customer_support",
        "topic": "support",
        "user_responses": [
          "I need help",
          "Thank you"
        ]
      }
    ],
    "num_episodes": 50,
    "profile": "balanced",
    "resume_from_checkpoint": "./outputs/checkpoint-100",
    "reward_config": {
      "helpfulness_weight": 0.7,
      "safety_weight": 0.3
    },
    "training_config_overrides": {
      "continual_strategy": "replay_lwf",
      "replay_ratio": 0.3
    }
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "training_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "status": "pending",
    "estimated_time": 1.5,
    "message": "Two-person tent, green — replacement for damaged pole set."
  }
  ```
</ResponseExample>
