Skip to content

Gateway proxy: OpenAI-compatible /v1/files endpoint #504

Closed

Description

@vgmartinez

Goal

Proxy OpenAI-style Files API through TrustGate (/{consumer}/v1/files …) so clients can upload/list/retrieve/delete files under gateway auth + governance.

Who supports Files (2026-08-22 scan)

First-class /v1/files-style (good TrustGate targets)

Provider API Notes
OpenAI POST/GET/DELETE /v1/files Purpose: assistants, batch, fine-tune, vision, user_data, … Up to 512MB/file
Azure OpenAI {endpoint}/openai/files (+ api-version) Same family as OpenAI; purpose required
OpenRouter /api/v1/files Own workspace storage or ?provider=openai BYOK to upstream. List/upload/get/delete/download
Anthropic POST /v1/files Beta header historically; Claude API / some Foundry paths. Not on classic Bedrock/Vertex for Files
xAI (Grok) POST /v1/files OpenAI-shaped; optional expires_after; chat attachments by file_id
Mistral POST /v1/files Purposes: fine-tune, batch, ocr; ≤512MB
Google Gemini Files API (upload/v1beta/files / files.upload) Different wire (not OpenAI /v1/files); temp storage ~48h; URI referenced in generate

No dedicated Files API (or not the OpenAI pattern)

Provider Reality
Groq, Fireworks, Together, DeepSeek, Cohere, Cerebras, … Typically no first-class files store; clients send base64/URL inline or use their own object store
AWS Bedrock No unified OpenAI-style Files; media usually via S3 / Knowledge Bases
Vertex AI (classic) Gemini File API not the same as Anthropic/OpenAI /v1/files

TrustGate today

Fixed proxy routes: chat + embeddings + rerank only. No /v1/files.

Suggested rollout for #504

  1. OpenAI + Azure (same wire family)
  2. OpenRouter (passthrough / optional provider query)
  3. xAI (close to OpenAI shape)
  4. Anthropic (adapt beta headers / response shape)
  5. Mistral (purpose enum differs)
  6. Gemini last (different protocol — adapter, not passthrough)

Scope notes

Acceptance criteria

  • POST /{slug}/v1/files works for OpenAI registry
  • List/get/delete for OpenAI + at least one of Azure/OpenRouter/xAI
  • Docs + functional tests
  • PR only (never merge from automation)

Related

Activity

  1. Triumph1701 commented on Aug 23, 2026

    @Triumph1701

    The provider matrix is a good start, but I’d keep the gateway’s file identity and lifecycle provider-neutral. A file ID should map to a gateway-owned record with consumer/tenant scope, provider capabilities, retention, and an audit trail; upstream IDs can remain adapter details. For providers without a native files API, the adapter should fail clearly rather than silently turning an upload into an inline base64 request. The acceptance tests should cover cross-provider IDs, multipart limits, delete semantics, and partial failure cleanup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions