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

# AI agent for DRG classification from clinical text

> 
Use an AI agent to classify hospital encounters into MS-DRG codes from
natural language clinical text. The agent can extract ICD-10 codes from
clinical descriptions and explain DRG assignments.

**LLM cost:** ~$0.01-0.05 per request (uses Claude Sonnet via AWS Bedrock).

For structured ICD-10 code input, use the `/api/v1/drg/classify/` endpoint instead ($0 cost).
    



## OpenAPI

````yaml /api/openapi-commercial.yaml post /api/v1/drg/agent/
openapi: 3.0.3
info:
  title: Healthproximate API
  version: 1.0.0
  description: >-
    DRG classification, OMOP vocabulary services and a PHI-safe LLM gateway.


    Generated by `manage.py export_commercial_openapi` from an explicit
    operation allowlist (`app/openapi_commercial.py`). An endpoint appears here
    because someone published it, never because it exists.
  contact:
    email: admin@valiancehealth.ai
servers:
  - url: https://api.v2.healthproximate.com
security: []
tags:
  - name: DRG
    description: MS-DRG classification from coded input, free clinical text, or FHIR.
  - name: Vocabulary
    description: OMOP concept search, coding, translation and hierarchy resolution.
  - name: Gateway
    description: >-
      PHI-safe LLM access. Text is redacted before any model sees it and
      re-hydrated in the answer, and every response carries a receipt.
paths:
  /api/v1/drg/agent/:
    post:
      tags:
        - DRG
      summary: AI agent for DRG classification from clinical text
      description: >-

        Use an AI agent to classify hospital encounters into MS-DRG codes from

        natural language clinical text. The agent can extract ICD-10 codes from

        clinical descriptions and explain DRG assignments.


        **LLM cost:** ~$0.01-0.05 per request (uses Claude Sonnet via AWS
        Bedrock).


        For structured ICD-10 code input, use the `/api/v1/drg/classify/`
        endpoint instead ($0 cost).
            
      operationId: v1_drg_agent_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DRGAgentRequestRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/DRGAgentRequestRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/DRGAgentRequestRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DRGAgentResponse'
              examples:
                HIVDiagnosis:
                  value:
                    response: >-
                      Based on the diagnosis code B20 (HIV disease), this
                      classifies to **DRG 977** - HIV WITH RELATED CONDITION...
                    token_usage:
                      input_tokens: 1520
                      output_tokens: 340
                    response_time_ms: 3200
                  summary: HIV Diagnosis
          description: Agent response with DRG classification
        '400':
          description: Invalid request
        '401':
          description: Authentication required
        '500':
          description: Internal server error
      security:
        - api_key_auth: []
        - jwt_auth: []
components:
  schemas:
    DRGAgentRequestRequest:
      type: object
      description: Request serializer for the DRG AI agent endpoint.
      properties:
        message:
          type: string
          minLength: 1
          description: >-
            Natural language clinical text or DRG question (max 20,000
            characters)
          maxLength: 20000
        version:
          allOf:
            - $ref: '#/components/schemas/VersionEnum'
          description: |-
            Optional MS-DRG version hint for the agent

            * `v36` - v36
            * `v37` - v37
            * `v38` - v38
            * `v39` - v39
            * `v40` - v40
            * `v43` - v43
        deidentified:
          type: boolean
          default: false
          description: Whether the input clinical text has already been de-identified
      required:
        - message
    DRGAgentResponse:
      type: object
      description: Response serializer for the DRG AI agent endpoint.
      properties:
        response:
          type: string
          description: Agent's natural language response
        token_usage:
          type: object
          additionalProperties: {}
          description: Token usage breakdown from the LLM
        response_time_ms:
          type: integer
          description: Response time in milliseconds
      required:
        - response
        - response_time_ms
        - token_usage
    VersionEnum:
      enum:
        - v36
        - v37
        - v38
        - v39
        - v40
        - v43
      type: string
      description: |-
        * `v36` - v36
        * `v37` - v37
        * `v38` - v38
        * `v39` - v39
        * `v40` - v40
        * `v43` - v43
  securitySchemes:
    api_key_auth:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        API key for organization authentication. Obtain from the organization
        settings or API key management endpoint.
    jwt_auth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT access token obtained from /login/ endpoint

````