Zum Inhalt springen
DeutschlandGPT

Upload file to Custom GPT

Uploads and links a file to a Custom GPT. Max 50 MB. Only common document, image, audio, video, text, and archive types are accepted and validated against their declared type (magic bytes); disallowed or mismatched files return 400. A Custom GPT holds at most 20 files, of which at most 10 may be images; a file past either limit returns 409. An API key whose creator account no longer exists cannot upload and gets 422.

POSThttps://api.deutschlandgpt.de/v2/custom-gpts/{id}/files

Example request

curl https://api.deutschlandgpt.de/v2/custom-gpts/{id}/files \
  -X POST \
  -H "Authorization: Bearer $DGPT_API_KEY"

Parameters

idstring<uuid>required

Custom GPT ID

Response

201application/json
{
  "file_id": "string"
}

File uploaded and linked

file_idstring

Response codes

201

File uploaded and linked

object
400

Invalid file type or size

401

Unauthorized

402

Insufficient credits or spending limit exceeded

Error
404

Custom GPT not found or access denied

409

The Custom GPT already holds the maximum of 20 files or 10 images

Error
422

The API key has no creator account that could own the file

Error
Was this page helpful?