---
title: "Create a file in a container"
method: POST
path: "/v1/containers/{container_id}/files"
tags: ["Containers"]
---

# Create a file in a container

`POST /v1/containers/{container_id}/files`

Creates a new file in a container. You can either upload file content directly
via multipart/form-data or reference an existing file by its ID.

## Path parameters

- `container_id` string, required

## Query parameters

- `provider` 'openai' | 'azure' | 'anthropic' | 'bedrock' | 'cohere' | 'vertex' | 'vllm' | 'mistral' | 'ollama' | 'groq' | 'sgl' | 'parasail' | 'perplexity' | 'replicate' | 'cerebras' | 'deepseek' | 'gemini' | 'openrouter' | 'elevenlabs' | 'huggingface' | 'nebius' | 'xai' | 'runway' | 'fireworks', required — AI model provider identifier

## Request body

- object — Request to create a file in a container by referencing an existing file
  - `file_id` string, required — The ID of an existing file to copy into the container
  - `file_path` string — Optional path for the file within the container

## Response `200`

Successful response

- object — Response from creating a file in a container
  - `id` string — The unique identifier for the created file
  - `object` string — The object type (always "container.file")
  - `container_id` string — The ID of the container this file belongs to
  - `path` string — The path of the file within the container
  - `bytes` integer — The size of the file in bytes
  - `created_at` integer — Unix timestamp of when the file was created
  - `source` string — The source of the file
  - `extra_fields` BifrostResponseExtraFields — Additional fields included in responses
    - `request_type` string — Type of request that was made
    - `provider` 'openai' | 'azure' | 'anthropic' | 'bedrock' | 'cohere' | 'vertex' | 'vllm' | 'mistral' | 'ollama' | 'groq' | 'sgl' | 'parasail' | 'perplexity' | 'replicate' | 'cerebras' | 'deepseek' | 'gemini' | 'openrouter' | 'elevenlabs' | 'huggingface' | 'nebius' | 'xai' | 'runway' | 'fireworks' — AI model provider identifier
    - `model_requested` string — The model that was requested
    - `model_deployment` string — The actual model deployment used
    - `latency` integer — Request latency in milliseconds
    - `chunk_index` integer — Index of the chunk for streaming responses
    - `raw_request` object — Raw request if enabled
    - `raw_response` object — Raw response if enabled
    - `cache_debug` BifrostCacheDebug
      - `cache_hit` boolean
      - `cache_id` string
      - `hit_type` string
      - `requested_provider` string
      - `requested_model` string
      - `provider_used` string
      - `model_used` string
      - `input_tokens` integer
      - `threshold` number
      - `similarity` number

## Other responses

- `400` — Bad request
- `500` — Internal server error

---

[API](https://skmtc.net/getbifrost/apis/bifrost-api.md) · [All operations](https://skmtc.net/getbifrost/apis/bifrost-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/getbifrost/bifrost-api/versions/f8cab88f64ea/schema)
