WebsitePlatform Login

Assistant Files

Assistant Files API

Diese API ist ein Premium-Feature und muss fuer deine Organisation freigeschaltet werden. Kontaktiere den Support, um Zugriff zu erhalten.

Authentifizierung

Diese API verwendet User API Keys. Diese koennen in den User-Settings erstellt werden und haben das Prefix sk_meingpt_.

curl -X GET "https://app.meingpt.com/api/assistant-files/v1/assistants/{assistantId}/files" \
  -H "Authorization: Bearer $MEINGPT_API_KEY"

Berechtigungen

  • Dateien auflisten / Metadaten abrufen: Erfordert VIEW, EDIT oder OWNER Berechtigung fuer den Assistenten
  • Dateien hochladen / ersetzen / loeschen: Erfordert EDIT oder OWNER Berechtigung fuer den Assistenten

Endpoints

GET
/assistant-files/v1/assistants/{assistantId}/files
Authorization<token>

API-Schlüssel zur Authentifizierung. Verwenden Sie das Format 'Bearer <Ihr-API-Schlüssel>'.

In: header

Path Parameters

assistantIdstring

Die AssistantId

Response Body

curl -X GET "https://app.meingpt.com/api/assistant-files/v1/assistants/string/files"
{
  "files": [
    {
      "id": "string",
      "originalName": "string",
      "mimeType": "string",
      "size": 0,
      "createdAt": "string",
      "updatedAt": "string"
    }
  ],
  "count": 0,
  "assistantId": "string"
}
{
  "status": "error",
  "message": "string"
}
{
  "status": "error",
  "message": "string"
}
{
  "status": "error",
  "message": "string"
}
POST
/assistant-files/v1/assistants/{assistantId}/files
Authorization<token>

API-Schlüssel zur Authentifizierung. Verwenden Sie das Format 'Bearer <Ihr-API-Schlüssel>'.

In: header

Path Parameters

assistantIdstring

Die AssistantId

file?file
Formatbinary

Response Body

curl -X POST "https://app.meingpt.com/api/assistant-files/v1/assistants/string/files"
{
  "success": true,
  "assistantId": "string",
  "file": {
    "id": "string",
    "originalName": "string",
    "size": 0,
    "mimeType": "string",
    "uploadedAt": "string"
  }
}
{
  "status": "error",
  "message": "string"
}
{
  "status": "error",
  "message": "string"
}
{
  "status": "error",
  "message": "string"
}
GET
/assistant-files/v1/assistants/{assistantId}/files/{documentId}
Authorization<token>

API-Schlüssel zur Authentifizierung. Verwenden Sie das Format 'Bearer <Ihr-API-Schlüssel>'.

In: header

Path Parameters

assistantIdstring

Die AssistantId

documentIdstring

Die DocumentId

Response Body

curl -X GET "https://app.meingpt.com/api/assistant-files/v1/assistants/string/files/string"
{
  "id": "string",
  "originalName": "string",
  "mimeType": "string",
  "size": 0,
  "createdAt": "string",
  "updatedAt": "string",
  "processingStatus": "string",
  "derivations": [
    "string"
  ],
  "assistantId": "string"
}
{
  "status": "error",
  "message": "string"
}
{
  "status": "error",
  "message": "string"
}
{
  "status": "error",
  "message": "string"
}
PUT
/assistant-files/v1/assistants/{assistantId}/files/{documentId}
Authorization<token>

API-Schlüssel zur Authentifizierung. Verwenden Sie das Format 'Bearer <Ihr-API-Schlüssel>'.

In: header

Path Parameters

assistantIdstring

Die AssistantId

documentIdstring

Die DocumentId, die ersetzt werden soll

file?file
Formatbinary

Response Body

curl -X PUT "https://app.meingpt.com/api/assistant-files/v1/assistants/string/files/string"
{
  "success": true,
  "assistantId": "string",
  "replacedId": "string",
  "originalId": "string",
  "file": {
    "id": "string",
    "originalName": "string",
    "size": 0,
    "mimeType": "string",
    "uploadedAt": "string"
  }
}
{
  "status": "error",
  "message": "string"
}
{
  "status": "error",
  "message": "string"
}
{
  "status": "error",
  "message": "string"
}
DELETE
/assistant-files/v1/assistants/{assistantId}/files/{documentId}
Authorization<token>

API-Schlüssel zur Authentifizierung. Verwenden Sie das Format 'Bearer <Ihr-API-Schlüssel>'.

In: header

Path Parameters

assistantIdstring

Die AssistantId

documentIdstring

Die DocumentId

Response Body

curl -X DELETE "https://app.meingpt.com/api/assistant-files/v1/assistants/string/files/string"
{
  "success": true,
  "assistantId": "string",
  "originalId": "string"
}
{
  "status": "error",
  "message": "string"
}
{
  "status": "error",
  "message": "string"
}
{
  "status": "error",
  "message": "string"
}

Beim Ersetzen einer Datei wird zuerst ein neues Dokument hochgeladen und anschliessend das alte geloescht. Der Upload erhaelt dabei eine neue id.

AssistantId finden

  1. Gehe in den Bearbeitungsmodus deines Assistenten
  2. In der URL findest du hinter /assistants/ die AssistantId

AssistantId im Assistant Bearbeitungsmodus