Create an upload
Creates a one-time upload for a file you cannot send in the same
request, for example from an MCP tool or a chat assistant. Once it is
uploaded, pass upload:<uploadId> wherever a create or replace takes
a file URL.
kind | Accepts |
|---|---|
portrait | jpg, png or webp, up to 10 MB |
voice | a 10 to 60 second recording: mp3, wav, m4a, aac, ogg, flac, opus or webm, up to 12 MB |
knowledge | pdf, docx, doc, txt, md, html or csv up to 50 MB; audio or video up to 20 MB |
Send the file one of two ways:
PUTit touploadUrlwithuploadHeaders(aContent-TypefromallowedTypesif you declared none), at mostmaxBytes:curl -X PUT -H 'Content-Type: image/png' --data-binary @portrait.png '<uploadUrl>'.- Or give a person
uploadPageUrl, a page that takes the file (or records a voice). It works for 15 minutes (uploadPageExpiresAt) and until the file arrives.
Then poll GET /v1/uploads/{uploadId} until status is uploaded. An
upload is used once and expires an hour after it was created.
contentType, when given, is the only type accepted.
Scopes: portrait and voice uploads (a clip's inputs) need
generation:write or avatars:write; knowledge uploads need
avatars:write. A key with generation:write alone can feed clips
but still cannot create or change an avatar with the upload.
X-Api-Key<token>Your secret API key (sk_atmee_...; older keys start sk_live_),
sent as X-Api-Key. Keep it on your server and never send it to a
browser.
application/json- body
kind*UploadKind"portrait""voice""knowledge"fileName?stringThe file's name; a knowledge file is stored and described under it.
length <= 255contentType?stringThe file's type, one this kind takes; the upload then accepts only it.
length <= 255The upload, waiting for its file.
application/json- response
uploadId*stringuuidkind*UploadKind"portrait""voice""knowledge"status*"pending""pending"uploadUrl*stringThe signed target to PUT the file's bytes to, before expiresAt.
uriuploadHeaders*Headers the PUT must send. Without a declared contentType, send a Content-Type from allowedTypes.
maxBytes*integerThe most bytes the PUT takes. A knowledge upload declared as audio or video gets the media cap (20 MB), one declared as a document or with no type the document cap (50 MB).
int64allowedTypes*array<string>expiresAt*stringdate-timeuploadPageUrl?stringA page a person opens to upload the file (or record a voice). Absent where no page is served.
uriuploadPageExpiresAt?stringdate-timecurl -X POST 'https://api.atmanity.us/v1/uploads' \ -H 'Content-Type: application/json' \ -d '{ "kind": "portrait"}'{ "uploadId": "ef523ba8-509e-47af-8e2c-5fa751596497", "kind": "portrait", "status": "pending", "uploadUrl": "http://example.com", "uploadHeaders": { "property1": "string", "property2": "string" }, "maxBytes": 0, "allowedTypes": [ "string" ], "expiresAt": "2019-08-24T14:15:22Z", "uploadPageUrl": "http://example.com", "uploadPageExpiresAt": "2019-08-24T14:15:22Z"}Set the thumbnail PUT
Sets a custom thumbnail for the avatar's Explore card, replacing any other; automatic thumbnails are no longer made for it.
Get an upload GET
Returns the upload's status: pending until the file arrives, then uploaded (usable once), consumed once a create or replace used it, or expired an hour after it was created.

