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

# Translate text to Spanish

> Translates the provided text to Spanish using OpenAI.

**Note**: The AI model is configured server-side and cannot be specified in the request.

**x402 Payment Required**: This endpoint requires payment via the x402 protocol (version 1).
- First request: Returns 402 with payment requirements in `x-payment` header
- Second request: Include `X-Payment` header with signed payment authorization




## OpenAPI

````yaml post /llm/translate
openapi: 3.0.0
info:
  title: HTTPayer Proxy API
  version: 1.0.0
  description: >-
    HTTPayer is a payment router for 402 response codes and the x402 Protocol.
    Users can access APIs that use the x402 standard through the HTTPayer proxy.
  contact:
    name: HTTPayer Team
    url: https://httpayer.com
servers:
  - url: https://api.httpayer.com
    description: Production server
security: []
tags:
  - name: Relay
    description: Cross-chain payment relay endpoints
  - name: Account
    description: Account balance and limits endpoints
  - name: Webhooks
    description: Async task status and webhooks
  - name: LLM
    description: OpenAI-powered endpoints for translation and chat
  - name: Health
    description: Health check endpoints
paths:
  /llm/translate:
    post:
      tags:
        - LLM
      summary: Translate text to Spanish
      description: >
        Translates the provided text to Spanish using OpenAI.


        **Note**: The AI model is configured server-side and cannot be specified
        in the request.


        **x402 Payment Required**: This endpoint requires payment via the x402
        protocol (version 1).

        - First request: Returns 402 with payment requirements in `x-payment`
        header

        - Second request: Include `X-Payment` header with signed payment
        authorization
      parameters:
        - in: header
          name: X-Payment
          schema:
            type: string
          description: >-
            x402 v1 payment authorization header (base64-encoded JSON). Include
            on second request after receiving 402.
          required: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - text
              properties:
                text:
                  type: string
                  description: Text to translate to Spanish
                  example: Hello, how are you?
      responses:
        '200':
          description: Translation successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  original:
                    type: string
                    description: Original text
                    example: Hello, how are you?
                  translation:
                    type: string
                    description: Translated text in Spanish
                    example: Hola, ¿cómo estás?
                  model:
                    type: string
                    description: OpenAI model used (server-configured)
                    example: gpt-4o-mini-2024-07-18
        '400':
          description: Bad request - missing text field
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Text field is required
        '402':
          description: Payment Required - x402 v1 payment needed
          headers:
            x-payment:
              schema:
                type: string
              description: >-
                Base64-encoded x402 v1 payment requirements (includes network,
                amount, payTo address, etc.)
          content:
            application/json:
              schema:
                type: object
                properties:
                  x402Version:
                    type: integer
                    example: 1
                  error:
                    type: string
                    example: Payment Required
                  accepts:
                    type: array
                    items:
                      type: object
                      properties:
                        scheme:
                          type: string
                          example: exact
                        network:
                          type: string
                          example: base
                        payTo:
                          type: string
                        asset:
                          type: string
                        maxAmountRequired:
                          type: string
        '500':
          description: Translation failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Translation failed
                  message:
                    type: string
        '503':
          description: OpenAI service not configured

````