OpenAI · Capability

OpenAI files — Files

OpenAI files — Files. 5 operations. Lead operation: OpenAI Returns a list of files that belong to the user's organization.. Self-contained Naftiko capability covering one Openai business surface.

Run with Naftiko OpenaiFiles

What You Can Do

GET
Listfiles — OpenAI Returns a list of files that belong to the user's organization.
/v1/files
POST
Createfile — Upload a file that can be used across various endpoints. The size of all the files uploaded by one organization can be up to 100 GB.
/v1/files
DELETE
Deletefile — OpenAI Delete a file.
/v1/files/{file-id}
GET
Retrievefile — OpenAI Returns information about a specific file.
/v1/files/{file-id}
GET
Downloadfile — OpenAI Returns the contents of the specified file.
/v1/files/{file-id}/content

MCP Tools

openai-returns-list-files-that

OpenAI Returns a list of files that belong to the user's organization.

read-only idempotent
upload-file-that-can-be

Upload a file that can be used across various endpoints. The size of all the files uploaded by one organization can be up to 100 GB.

openai-delete-file

OpenAI Delete a file.

idempotent
openai-returns-information-about-specific

OpenAI Returns information about a specific file.

read-only idempotent
openai-returns-contents-specified-file

OpenAI Returns the contents of the specified file.

read-only idempotent

Capability Spec

files-files.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: OpenAI files — Files
  description: 'OpenAI files — Files. 5 operations. Lead operation: OpenAI Returns a list of files that belong to the user''s
    organization.. Self-contained Naftiko capability covering one Openai business surface.'
  tags:
  - Openai
  - Files
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    OPENAI_API_KEY: OPENAI_API_KEY
capability:
  consumes:
  - type: http
    namespace: files-files
    baseUri: https://api.openai.com/v1
    description: OpenAI files — Files business capability. Self-contained, no shared references.
    resources:
    - name: files
      path: /files
      operations:
      - name: listfiles
        method: GET
        description: OpenAI Returns a list of files that belong to the user's organization.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: purpose
          in: query
          type: string
          description: Only return files with the given purpose.
      - name: createfile
        method: POST
        description: Upload a file that can be used across various endpoints. The size of all the files uploaded by one organization
          can be up to 100 GB.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    - name: files-file_id
      path: /files/{file_id}
      operations:
      - name: deletefile
        method: DELETE
        description: OpenAI Delete a file.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: file_id
          in: path
          type: string
          description: The ID of the file to use for this request.
          required: true
      - name: retrievefile
        method: GET
        description: OpenAI Returns information about a specific file.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: file_id
          in: path
          type: string
          description: The ID of the file to use for this request.
          required: true
    - name: files-file_id-content
      path: /files/{file_id}/content
      operations:
      - name: downloadfile
        method: GET
        description: OpenAI Returns the contents of the specified file.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: file_id
          in: path
          type: string
          description: The ID of the file to use for this request.
          required: true
    authentication:
      type: bearer
      token: '{{env.OPENAI_API_KEY}}'
  exposes:
  - type: rest
    namespace: files-files-rest
    port: 8080
    description: REST adapter for OpenAI files — Files. One Spectral-compliant resource per consumed operation, prefixed with
      /v1.
    resources:
    - path: /v1/files
      name: files
      description: REST surface for files.
      operations:
      - method: GET
        name: listfiles
        description: OpenAI Returns a list of files that belong to the user's organization.
        call: files-files.listfiles
        with:
          purpose: rest.purpose
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: createfile
        description: Upload a file that can be used across various endpoints. The size of all the files uploaded by one organization
          can be up to 100 GB.
        call: files-files.createfile
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/files/{file-id}
      name: files-file-id
      description: REST surface for files-file_id.
      operations:
      - method: DELETE
        name: deletefile
        description: OpenAI Delete a file.
        call: files-files.deletefile
        with:
          file_id: rest.file_id
        outputParameters:
        - type: object
          mapping: $.
      - method: GET
        name: retrievefile
        description: OpenAI Returns information about a specific file.
        call: files-files.retrievefile
        with:
          file_id: rest.file_id
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/files/{file-id}/content
      name: files-file-id-content
      description: REST surface for files-file_id-content.
      operations:
      - method: GET
        name: downloadfile
        description: OpenAI Returns the contents of the specified file.
        call: files-files.downloadfile
        with:
          file_id: rest.file_id
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: files-files-mcp
    port: 9090
    transport: http
    description: MCP adapter for OpenAI files — Files. One tool per consumed operation, routed inline through this capability's
      consumes block.
    tools:
    - name: openai-returns-list-files-that
      description: OpenAI Returns a list of files that belong to the user's organization.
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: files-files.listfiles
      with:
        purpose: tools.purpose
      outputParameters:
      - type: object
        mapping: $.
    - name: upload-file-that-can-be
      description: Upload a file that can be used across various endpoints. The size of all the files uploaded by one organization
        can be up to 100 GB.
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: files-files.createfile
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: openai-delete-file
      description: OpenAI Delete a file.
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: files-files.deletefile
      with:
        file_id: tools.file_id
      outputParameters:
      - type: object
        mapping: $.
    - name: openai-returns-information-about-specific
      description: OpenAI Returns information about a specific file.
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: files-files.retrievefile
      with:
        file_id: tools.file_id
      outputParameters:
      - type: object
        mapping: $.
    - name: openai-returns-contents-specified-file
      description: OpenAI Returns the contents of the specified file.
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: files-files.downloadfile
      with:
        file_id: tools.file_id
      outputParameters:
      - type: object
        mapping: $.