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

# Create Training Run Route

> Create and launch an eval, train, and post-training eval workflow.



## OpenAPI

````yaml /openapi.json post /api/v1/train
openapi: 3.1.0
info:
  title: Trajectory API
  version: 0.1.0
servers:
  - url: https://api.trajectory.ai
security: []
paths:
  /api/v1/train:
    post:
      tags:
        - training
      summary: Create Training Run Route
      description: Create and launch an eval, train, and post-training eval workflow.
      operationId: createTrainingRun
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTrainingRunRequest'
        required: true
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateTrainingRunResponse'
        default:
          $ref: '#/components/responses/ApiErrorResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    CreateTrainingRunRequest:
      properties:
        bench_id:
          type: string
          title: Bench Id
        base_model_id:
          $ref: '#/components/schemas/BaseModelSlug'
          description: Base model to evaluate, train, and evaluate again.
        training_options:
          $ref: '#/components/schemas/TrainingOptions'
          description: Optional settings applied to every stage of the training pipeline.
      additionalProperties: false
      type: object
      required:
        - bench_id
        - base_model_id
      title: CreateTrainingRunRequest
    CreateTrainingRunResponse:
      properties:
        bench_id:
          type: string
          title: Bench Id
        training_run_id:
          type: string
          title: Training Run Id
        pipeline_run_id:
          type: string
          title: Pipeline Run Id
        execution_id:
          type: string
          title: Execution Id
        pipeline_name:
          type: string
          title: Pipeline Name
        display_name:
          type: string
          title: Display Name
          description: User-facing name for the training run.
        experiment_name:
          type: string
          title: Experiment Name
        resolved_trajectory_options:
          $ref: '#/components/schemas/ResolvedTrajectoryTrainingOptions'
      type: object
      required:
        - bench_id
        - training_run_id
        - pipeline_run_id
        - execution_id
        - pipeline_name
        - display_name
        - experiment_name
        - resolved_trajectory_options
      title: CreateTrainingRunResponse
    BaseModelSlug:
      type: string
      enum:
        - Qwen/Qwen3.5-4B
        - Qwen/Qwen3.5-397B-A17B
        - Qwen/Qwen3.6-35B-A3B
        - nvidia/NVIDIA-Nemotron-3-Ultra-550B-A55B-BF16
        - nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-BF16
        - nvidia/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-BF16
        - openai/gpt-5-mini
        - openai/gpt-5.4-mini
        - openai/gpt-5.5
        - anthropic/claude-sonnet-4.6
        - google/gemini-3.1-pro-preview
      title: BaseModelSlug
    TrainingOptions:
      properties:
        max_output_tokens_per_step:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Max Output Tokens Per Step
          description: Maximum assistant output tokens allowed in one model step.
        max_total_tokens_per_trajectory:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Max Total Tokens Per Trajectory
          description: Maximum total tokens available across one trajectory.
        max_turns_per_trajectory:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Max Turns Per Trajectory
          description: Maximum agent and environment turns allowed in each trajectory.
        max_tool_calls_per_step:
          anyOf:
            - type: integer
              minimum: 0
            - type: 'null'
          title: Max Tool Calls Per Step
          description: Maximum tool calls executed from one assistant step (0 rejects all).
        max_response_chars_per_tool_call:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Max Response Chars Per Tool Call
          description: Maximum tool-response characters retained before truncation.
      additionalProperties: false
      type: object
      title: TrainingOptions
    ResolvedTrajectoryTrainingOptions:
      properties:
        max_output_tokens_per_step:
          type: integer
          title: Max Output Tokens Per Step
        max_total_tokens_per_trajectory:
          type: integer
          title: Max Total Tokens Per Trajectory
        max_turns_per_trajectory:
          type: integer
          title: Max Turns Per Trajectory
        max_tool_calls_per_step:
          type: integer
          title: Max Tool Calls Per Step
        max_response_chars_per_tool_call:
          type: integer
          title: Max Response Chars Per Tool Call
        timeout_seconds:
          type: integer
          title: Timeout Seconds
      type: object
      required:
        - max_output_tokens_per_step
        - max_total_tokens_per_trajectory
        - max_turns_per_trajectory
        - max_tool_calls_per_step
        - max_response_chars_per_tool_call
        - timeout_seconds
      title: ResolvedTrajectoryTrainingOptions
    ApiErrorEnvelope:
      properties:
        error:
          $ref: '#/components/schemas/ApiErrorBody'
      required:
        - error
      title: ApiErrorEnvelope
      type: object
    ApiErrorBody:
      properties:
        type:
          $ref: '#/components/schemas/ErrorType'
        code:
          title: Code
          type: string
        message:
          type: string
          title: Message
        param:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Param
        doc_url:
          type: string
          title: Doc Url
        context:
          additionalProperties: true
          title: Context
          type: object
      required:
        - type
        - code
        - message
        - doc_url
        - context
      title: ApiErrorBody
      type: object
    ErrorType:
      enum:
        - invalid_request_error
        - authentication_error
        - permission_error
        - conflict_error
        - rate_limit_error
        - dependency_error
        - api_error
      title: ErrorType
      type: string
  responses:
    ApiErrorResponse:
      description: >-
        Common API error. Possible codes: `authentication_required`,
        `permission_denied`, `validation_error`, `rate_limited`,
        `internal_error`, `service_unavailable`.
      headers:
        X-Request-ID:
          $ref: '#/components/headers/RequestId'
        Trajectory-Should-Retry:
          $ref: '#/components/headers/TrajectoryShouldRetry'
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorEnvelope'
  headers:
    RequestId:
      schema:
        type: string
    TrajectoryShouldRetry:
      schema:
        type: boolean
    RetryAfter:
      schema:
        type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Organization API key

````