Hugging Face · Capability

Hugging Face Text Generation Inference API — Text Generation

Hugging Face Text Generation Inference API — Text Generation. 3 operations. Lead operation: Generate Text. Self-contained Naftiko capability covering one Hugging Face business surface.

Run with Naftiko Hugging FaceText Generation

What You Can Do

POST
Generate — Generate Text
/v1/generate
POST
Generatestream — Generate Text With Streaming
/v1/generate-stream
POST
Completions — Create Text Completion (openai Compatible)
/v1/v1/completions

MCP Tools

generate-text

Generate Text

generate-text-streaming

Generate Text With Streaming

create-text-completion-openai-compatible

Create Text Completion (openai Compatible)

Capability Spec

text-generation-inference-text-generation.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Hugging Face Text Generation Inference API — Text Generation
  description: 'Hugging Face Text Generation Inference API — Text Generation. 3 operations. Lead operation: Generate Text.
    Self-contained Naftiko capability covering one Hugging Face business surface.'
  tags:
  - Hugging Face
  - Text Generation
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    HUGGING_FACE_API_KEY: HUGGING_FACE_API_KEY
capability:
  consumes:
  - type: http
    namespace: text-generation-inference-text-generation
    baseUri: https://api-inference.huggingface.co
    description: Hugging Face Text Generation Inference API — Text Generation business capability. Self-contained, no shared
      references.
    resources:
    - name: generate
      path: /generate
      operations:
      - name: generate
        method: POST
        description: Generate Text
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    - name: generate_stream
      path: /generate_stream
      operations:
      - name: generatestream
        method: POST
        description: Generate Text With Streaming
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    - name: v1-completions
      path: /v1/completions
      operations:
      - name: completions
        method: POST
        description: Create Text Completion (openai Compatible)
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    authentication:
      type: bearer
      token: '{{env.HUGGING_FACE_API_KEY}}'
  exposes:
  - type: rest
    namespace: text-generation-inference-text-generation-rest
    port: 8080
    description: REST adapter for Hugging Face Text Generation Inference API — Text Generation. One Spectral-compliant resource
      per consumed operation, prefixed with /v1.
    resources:
    - path: /v1/generate
      name: generate
      description: REST surface for generate.
      operations:
      - method: POST
        name: generate
        description: Generate Text
        call: text-generation-inference-text-generation.generate
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/generate-stream
      name: generate-stream
      description: REST surface for generate_stream.
      operations:
      - method: POST
        name: generatestream
        description: Generate Text With Streaming
        call: text-generation-inference-text-generation.generatestream
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/v1/completions
      name: v1-completions
      description: REST surface for v1-completions.
      operations:
      - method: POST
        name: completions
        description: Create Text Completion (openai Compatible)
        call: text-generation-inference-text-generation.completions
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: text-generation-inference-text-generation-mcp
    port: 9090
    transport: http
    description: MCP adapter for Hugging Face Text Generation Inference API — Text Generation. One tool per consumed operation,
      routed inline through this capability's consumes block.
    tools:
    - name: generate-text
      description: Generate Text
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: text-generation-inference-text-generation.generate
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: generate-text-streaming
      description: Generate Text With Streaming
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: text-generation-inference-text-generation.generatestream
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: create-text-completion-openai-compatible
      description: Create Text Completion (openai Compatible)
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: text-generation-inference-text-generation.completions
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.