uploads
Creates, updates, deletes, gets or lists a uploads resource.
Overview​
| Name | uploads |
| Type | Resource |
| Id | openai.uploads.uploads |
Fields​
The following fields are returned by SELECT queries:
SELECT not supported for this resource, use SHOW METHODS to view available operations for the resource.
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
create | insert | filename, purpose, bytes, mime_type | openai-organization, openai-project | |
cancel | exec | upload_id | openai-organization, openai-project | |
complete | exec | upload_id, part_ids | openai-organization, openai-project |
Parameters​
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
upload_id | string | The ID of the Upload. |
openai-organization | string | Optionally scope the request to a specific organization (overrides the default associated with the API key). Addressable in SQL as openai_organization. |
openai-project | string | Optionally scope the request to a specific project (overrides the default associated with the API key). Addressable in SQL as openai_project. |
INSERT examples​
- create
- Manifest
No description available.
INSERT INTO openai.uploads.uploads (
filename,
purpose,
bytes,
mime_type,
expires_after,
"openai-organization",
"openai-project"
)
SELECT
'{{ filename }}' /* required */,
'{{ purpose }}' /* required */,
{{ bytes }} /* required */,
'{{ mime_type }}' /* required */,
'{{ expires_after }}',
'{{ openai-organization }}',
'{{ openai-project }}'
RETURNING
id,
bytes,
created_at,
expires_at,
file,
filename,
object,
purpose,
status
;
# Description fields are for documentation purposes
- name: uploads
props:
- name: filename
value: "{{ filename }}"
description: |
The name of the file to upload.
- name: purpose
value: "{{ purpose }}"
description: |
The intended purpose of the uploaded file.
See the [documentation on File
purposes](https://platform.openai.com/docs/api-reference/files/create#files-create-purpose).
valid_values: ['assistants', 'batch', 'fine-tune', 'vision']
- name: bytes
value: {{ bytes }}
description: |
The number of bytes in the file you are uploading.
- name: mime_type
value: "{{ mime_type }}"
description: |
The MIME type of the file.
This must fall within the supported MIME types for your file purpose. See
the supported MIME types for assistants and vision.
- name: expires_after
description: |
The expiration policy for a file. By default, files with `purpose=batch` expire after 30 days and all other files are persisted until they are manually deleted.
value:
anchor: "{{ anchor }}"
seconds: {{ seconds }}
- name: openai-organization
value: "{{ openai-organization }}"
description: Optionally scope the request to a specific organization (overrides the default associated with the API key). Addressable in SQL as `openai_organization`.
description: Optionally scope the request to a specific organization (overrides the default associated with the API key). Addressable in SQL as `openai_organization`.
- name: openai-project
value: "{{ openai-project }}"
description: Optionally scope the request to a specific project (overrides the default associated with the API key). Addressable in SQL as `openai_project`.
description: Optionally scope the request to a specific project (overrides the default associated with the API key). Addressable in SQL as `openai_project`.
Lifecycle Methods​
- cancel
- complete
OK
EXEC openai.uploads.uploads.cancel
@upload_id='{{ upload_id }}' --required,
@openai-organization='{{ openai-organization }}',
@openai-project='{{ openai-project }}'
;
OK
EXEC openai.uploads.uploads.complete
@upload_id='{{ upload_id }}' --required,
@openai-organization='{{ openai-organization }}',
@openai-project='{{ openai-project }}'
@@json=
'{
"part_ids": "{{ part_ids }}",
"md5": "{{ md5 }}"
}'
;