Skip to content

Response Schema

This page documents request validation, output modes, and response envelope shapes for POST /v1.0.0/analyze.

Request schema

{
  "input_text": "string"
}

Validation:

  • input_text cannot be empty after trim
  • max length: 15,000 characters

Common success headers

All successful analyze responses include:

  • X-Requests-Remaining: remaining monthly requests for current user tier
  • X-Reset-At: ISO-8601 timestamp when current window resets

Output mode payloads

Full Output

{
  "negative_markers": {
    "table_output": [
      {
        "Psychological_Marker": "Rumination",
        "Sub_Type": "Self-Critical Loop",
        "Confidence": 8,
        "Valence": -2,
        "Arousal": 7,
        "Prevalence": 5
      }
    ],
    "explanatory_output": "..."
  },
  "positive_markers": {
    "table_output": [
      {
        "Skill": "Affect Regulation",
        "Sub_Dimension": "Pause before reaction",
        "Competence": 7,
        "Confidence": 8,
        "Skill_Use": "Applied",
        "Reflection_Depth": "Moderate"
      }
    ],
    "explanatory_output": "..."
  }
}

Negative Table

{
  "negative_markers": {
    "table_output": [
      {
        "Psychological_Marker": "Cognitive Distortion",
        "Sub_Type": "Catastrophizing",
        "Confidence": 8,
        "Valence": -2,
        "Arousal": 7,
        "Prevalence": 4
      }
    ]
  }
}

Negative Explanatory

{
  "negative_markers": {
    "explanatory_output": "..."
  }
}

Negative Combined

{
  "negative_markers": {
    "table_output": [],
    "explanatory_output": "..."
  }
}

Positive Table

{
  "positive_markers": {
    "table_output": [
      {
        "Skill": "Self Efficacy",
        "Sub_Dimension": "Agency statement",
        "Competence": 7,
        "Confidence": 8,
        "Skill_Use": "Applied",
        "Reflection_Depth": "Moderate"
      }
    ]
  }
}

Positive Explanatory

{
  "positive_markers": {
    "explanatory_output": "..."
  }
}

Positive Combined

{
  "positive_markers": {
    "table_output": [],
    "explanatory_output": "..."
  }
}

Both Tables Combined

{
  "combined_tables": {
    "negative_table_output": [],
    "positive_table_output": []
  }
}

Both Explanatory Combined

{
  "combined_explanatory": {
    "negative_explanatory_output": "...",
    "positive_explanatory_output": "..."
  }
}

Parsing failure case

If table JSON from the model cannot be parsed, the API returns HTTP 500 with:

{
  "detail": {
    "error": "analysis_parsing_error",
    "message": "Failed to parse analysis results"
  }
}