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

# Generate OEM from a state vector

> Generate CCSDS OEM v2.0 format ephemerides from a state vector with specified time range, reference frame, time system, and optional covariance propagation. Maximum time span is 30 days.



## OpenAPI

````yaml https://api.valar.space/api-docs/mintlify post /operations/state-vectors/{id}/generate-oem
openapi: 3.0.1
info:
  contact:
    email: api@valar.space
    name: Valar Space
    url: https://valar.space
  description: >-
    <H4>Welcome to the documentation for the Valar Operations API, here are some
    quick tips if you just landed!</H4><ol><li> The top level elements are the
    <b>Resources</b> accessible via the API and the different queries used to
    interact with each resource via the appropriate HTTP method call.</li><li>
    You can expand each method to get further information on the expected input
    parameters and the different responses that can be received.</li><li>For
    both the input parameters and responses, an <b>Example</b> is present for
    clarification.</li><li>For further details, the example snipped can be
    switched to <b>Schema</b> view, where a detailed explanation of each element
    can be found.</li><li>The <b>Try it out</b> button can be used to call the
    API directly from the documentation page, which allows for some easy testing
    and also provides the equivalent 'curl' command line code for easy
    portability of the call execution.</li><li><b>Before starting</b>, remember
    to use the token endpoint and activate the token with the <b>Authorize</b>
    button.</li></ol>
  title: API Documentation
  version: 1.0.0
servers:
  - url: /
    description: Default Server URL
  - url: https://api.valar.space
    description: API Server
security:
  - apiKeyAuth: []
tags:
  - description: >-
      Operations for managing state vectors — listing, importing, exporting, and
      deleting spacecraft state data
    name: State Vectors
paths:
  /operations/state-vectors/{id}/generate-oem:
    post:
      tags:
        - State Vectors
      summary: Generate OEM from a state vector
      description: >-
        Generate CCSDS OEM v2.0 format ephemerides from a state vector with
        specified time range, reference frame, time system, and optional
        covariance propagation. Maximum time span is 30 days.
      operationId: generateOem
      parameters:
        - description: State vector display ID
          example: SV-123
          in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OemGenerationRequest'
        required: true
      responses:
        '200':
          content:
            text/plain:
              example: |-
                CCSDS_OEM_VERS = 2.0
                CREATION_DATE = 2024-06-15T12:30:00
                ORIGINATOR = VALAR
                ...
              schema:
                type: string
          description: OEM file generated successfully
        '400':
          content:
            application/json:
              example:
                timestamp: '2025-01-15T10:30:00.000Z'
                status: 400
                error: Bad Request
                message: Time span cannot exceed 30 days
                path: /operations/state-vectors/{id}/generate-oem
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Invalid request parameters or validation errors
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BearerTokenErrorResponse'
          description: Not authenticated — missing or invalid bearer token
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Insufficient permissions
        '404':
          content:
            application/json:
              example:
                timestamp: '2025-01-15T10:30:00.000Z'
                status: 404
                error: Not Found
                message: 'StateVector not found with id: SV-999'
                path: /operations/state-vectors/SV-999/generate-oem
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: State vector not found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: >-
            Orbit is stale (ORBIT_STALE) — the generate-oem carve-out keeps its
            422 and is never acknowledged
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal error during OEM generation
components:
  schemas:
    OemGenerationRequest:
      required:
        - finalDate
        - initialDate
        - referenceFrame
        - timeBetweenPoints
        - timeSystem
      type: object
      properties:
        covarianceFrame:
          type: string
          description: Covariance reference frame for OEM covariance matrices
          example: RTN
          enum:
            - RTN
            - TNW
        covarianceFrameValid:
          type: boolean
        dateRangeValid:
          type: boolean
        finalDate:
          type: string
          description: End date for ephemeris generation in ISO-8601 format
          format: date-time
          example: '2024-01-02T00:00:00Z'
        includeCovariance:
          type: boolean
          description: Include covariance matrices in the OEM output
          example: false
          default: false
        initialDate:
          type: string
          description: Start date for ephemeris generation in ISO-8601 format
          format: date-time
          example: '2024-01-01T00:00:00Z'
        referenceFrame:
          type: string
          description: Reference frame for position and velocity vectors
          example: GCRF
          enum:
            - GCRF
            - EME2000
            - ITRF
            - TOD
            - MOD
            - TEME
        timeBetweenPoints:
          maximum: 86400
          minimum: 60
          type: integer
          description: Time step between ephemeris points in seconds
          format: int32
          example: 60
        timeSpanValid:
          type: boolean
        timeSystem:
          type: string
          description: Time system for ephemeris timestamps
          example: UTC
          enum:
            - UTC
            - TAI
            - TT
            - TDB
            - TCG
            - TCB
            - GPS
      description: >-
        Request parameters for OEM generation with configurable propagation
        settings
    ErrorResponse:
      type: object
      properties:
        details:
          type: object
          additionalProperties:
            type: object
            description: Structured error details with scenario-specific context fields
            nullable: true
          description: Structured error details with scenario-specific context fields
          nullable: true
        error:
          type: string
          description: HTTP status reason phrase or error category
          example: Bad Request
        fieldErrors:
          type: object
          additionalProperties:
            type: string
            description: >-
              Per-field validation error messages, present only for validation
              errors
            nullable: true
          description: >-
            Per-field validation error messages, present only for validation
            errors
          nullable: true
        message:
          type: string
          description: Detailed error message
          example: Validation failed
        path:
          type: string
          description: The request path where the error occurred
          example: /measurements
        status:
          type: integer
          description: The HTTP status code
          format: int32
          example: 400
        timestamp:
          type: string
          description: The timestamp when the error occurred
          format: date-time
          example: '2025-11-14T10:15:30.123Z'
    BearerTokenErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: OAuth 2.0 error code
          example: invalid_token
        error_description:
          type: string
          description: Human-readable error description
          example: An error occurred while attempting to decode the Jwt
      description: OAuth 2.0 Bearer Token error response (RFC 6750)
  securitySchemes:
    apiKeyAuth:
      description: 'API Key (format: vsp_sk_...)'
      scheme: bearer
      type: http

````