Omni Developers
Guides

Give your agent knowledge

Encrypt a local file, upload it to Omni, and wait until Vault reports READY.

  1. Local fileYour source bytes
  2. Encryptomni-file-v1
  3. UploadReturned PUT capability
  4. CompleteCiphertext stored
  5. READYVault processing finished
  6. AskAttach file_id
  7. [V1]Validated citation

The canonical runnable TypeScript example is examples/typescript/vault-upload.ts. It imports the same tested omni-file-v1 helper used by Omni rather than duplicating cryptography inside this page.

Python helper pending

A standalone Python encryption helper is not published yet. The first docs release ships the proven TypeScript implementation rather than improvising a second cryptographic implementation.

Encrypt locally and reserve

Generate a fresh 32-byte FEK and encrypt the source bytes with omni-file-v1. Reserve with POST /v1/files/uploads, including the logical filename, MIME type, plaintext and expected ciphertext sizes, encryption metadata, and vault_workspace_id.

Use a unique Idempotency-Key. Save data.file.file_id and the returned data.upload capability.

Upload exactly as directed

PUT the ciphertext to data.upload.url using its returned method and required_headers. The URL is a short-lived secret: use it directly and do not log it.

Complete storage

Call POST /v1/files/{file_id}/complete with another stable idempotency key. Completion verifies the upload exists and matches the expected size.

Wait for Vault

Poll GET /v1/workspaces/{workspace_id}/vault/files/{file_id} until data.file.status is ready. Stop and surface an error if it becomes failed or the polling deadline expires.

Wait for READY

complete means the ciphertext is stored. ready means Vault processing finished. Only a ready file should be attached to a task.

Continue to Ask with a file.

On this page