Upload File
Upload a file and return an id `chat/completions` can reference.
Authorization
ApiKey Your API key (sk-ast-...)
In: header
Request Body
multipart/form-data
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
curl -X POST "https://example.com/v1/files" \ -F file="string"{ "id": "string", "object": "file", "bytes": 0, "created_at": 0, "filename": "string", "purpose": "string"}Create Embeddings
Create embeddings for one or more texts. **Model.** `model` names an embedding model enabled for your organization, or `default` for the organization's primary one. Unlike chat, there is no fallback: two embedding models produce vectors in different latent spaces, so quietly answering from a second model would return vectors that cannot be compared with the ones you already have. **Dimensions.** Vectors come back at the model's native width. Pass `dimensions` to truncate, which only models supporting Matryoshka representation honour; one that does not will report so. **Encoding.** `float` returns JSON numbers, `base64` returns each vector as base64-encoded little-endian float32. Both are supported, and the OpenAI SDKs request `base64` by default. **Not supported.** `input` must be text: arrays of token ids are refused, because decoding them needs the embedding model's own tokenizer. `user` is accepted and unused; API traffic is attributed to the key and its project.
List Files
This organisation's files, newest first.