Reseter Space | GenAI API Docs
    Reseter Space | GenAI API Docs
    • Reseter Space developer platform
    • Text Generation
      POST
    • Upload File To Context To Generate Response With File Context
      POST
    • Generate Text With Search Tool
      POST
    • Image Generation
      POST
    • Create Multilingual Voices With TTSv1
      POST
    • Create Limited Language Voice with TTSv2
      POST

      Upload File To Context To Generate Response With File Context

      POST
      https://genai.reseter.space/api/v2/upload-file
      This API endpoint allows users to upload files and link them to a specific context through contextId. If no contextId is provided, the system will automatically generate a new identifier. When using an existing contextId, users need to ensure the validity of this code. After successful upload, the file will be integrated into the context and can be used by AI to generate text based on the file's content.

      Request

      Body Params multipart/form-data
      upload
      file 
      required
      Files to add to context, only .pdf files, text files, .png and .jpg images are accepted, other file types are automatically understood as text file types.
      contextId
      string 
      optional
      Context identifier to which the file is added, if not provided then autogenerated.
      Example:
      ndqthgZIKsHW7TUkAYHT

      Request samples

      Shell
      JavaScript
      Java
      Swift
      Go
      PHP
      Python
      HTTP
      C
      C#
      Objective-C
      Ruby
      OCaml
      Dart
      R
      Request Request Example
      Shell
      JavaScript
      Java
      Swift
      curl --location --request POST 'https://genai.reseter.space/api/v2/upload-file' \
      --form 'upload=@""' \
      --form 'contextId="ndqthgZIKsHW7TUkAYHT"'

      Responses

      🟢200Success
      application/json
      Body
      success
      boolean 
      required
      The result of executing the request, returns "true" if successful and vice versa.
      message
      string 
      required
      Additional server notifications (if required).
      contextId
      string 
      required
      The context code used to upload the file.
      timestamp
      string 
      required
      Timestamp of request made.
      error
      null 
      required
      Error information (if any, only return non-null in case of failed request).
      Example
      {
          "success": true,
          "message": "Successfully uploaded file",
          "contextId": "ndqthgZIKsHW7TUkAYHT",
          "timestamp": "2025-05-10 10:00:00",
          "error": null
      }
      Modified at 2025-05-09 19:00:10
      Previous
      Text Generation
      Next
      Generate Text With Search Tool
      Built with