> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coreweave.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a routed chat completion

> Send `OpenAI-Project: entity/project` to select a Model Distillation project, and `metadata["forge.project_version"]` to select a version (omit for v1). Omit `model`, leave it blank, or use `router` for configured routing. Set `model` to `provider/model` to override the model while retaining project attribution, conversation trace sampling, and opt-in caching. Override requests use the registered provider and caller parameters, not weighted target parameter defaults or overrides. Invalid headers are rejected without fallback.



## OpenAPI

````yaml openapi/model-distillation/proxy.openapi.yaml POST /chat/completions
openapi: 3.1.0
info:
  title: Model Distillation Inference Proxy
  version: 1.0.0
  description: >
    OpenAI-compatible Chat Completions with W&B authentication, task routing,

    provider credentials, parameter overrides, sticky traffic, and
    training-grade traces.
servers:
  - url: https://proxy.training.coreweave.com/v1
    description: Production
security:
  - WandbApiKey: []
tags:
  - name: Chat Completions
paths:
  /chat/completions:
    post:
      tags:
        - Chat Completions
      summary: Create a routed chat completion
      description: >-
        Send `OpenAI-Project: entity/project` to select a Model Distillation
        project, and `metadata["forge.project_version"]` to select a version
        (omit for v1). Omit `model`, leave it blank, or use `router` for
        configured routing. Set `model` to `provider/model` to override the
        model while retaining project attribution, conversation trace sampling,
        and opt-in caching. Override requests use the registered provider and
        caller parameters, not weighted target parameter defaults or overrides.
        Invalid headers are rejected without fallback.
      operationId: createChatCompletion
      parameters:
        - name: OpenAI-Project
          in: header
          required: false
          description: >-
            Weights & Biases entity/project owning the routing configuration.
            The caller must have access to the entity. Unknown projects return
            `404`. The validated project is forwarded to Serverless Inference
            for attribution.
          schema:
            type: string
            example: my-team/my-project
        - name: Forge-Cache-Mode
          in: header
          required: false
          description: >-
            Opt a non-streaming project request into exact-response caching.
            Cache identity includes the project version, the routing revision,
            the effective upstream request body, and forwarded path/query
            parameters. Model overrides are additionally isolated by provider
            configuration, model, and passthrough user identity. `readWrite`
            reads and populates the cache, `readOnly` reads without populating
            it, and `writeOnly` populates without reading. Only successful
            responses up to 8 MiB are stored. Invalid values return HTTP `400`.
            Response caching is not supported for streaming requests.
          schema:
            type: string
            enum:
              - readWrite
              - readOnly
              - writeOnly
      requestBody:
        required: true
        content:
          application/json:
            examples:
              task:
                summary: >-
                  Project-routed request (send OpenAI-Project:
                  your-team/ticket-classifier)
                value:
                  model: router
                  messages:
                    - role: user
                      content: Classify this support request.
                  metadata:
                    forge.project_version: '2'
                    gen_ai.conversation.id: conversation-4827
              override:
                summary: >-
                  Model override (send OpenAI-Project:
                  your-team/ticket-classifier)
                value:
                  model: openai/gpt-5.6-sol
                  messages:
                    - role: user
                      content: Say hello.
            schema:
              type: object
              properties:
                model:
                  description: >-
                    With `OpenAI-Project`, omit, leave blank, or use `router`
                    for configured routing. Use `{provider}/{model-id}` to
                    override the model within the project.
                  type: string
                messages:
                  minItems: 1
                  type: array
                  items:
                    type: object
                    properties:
                      role:
                        type: string
                        enum:
                          - developer
                          - system
                          - user
                          - assistant
                          - tool
                          - function
                      content:
                        description: >-
                          Text, multimodal content parts, or null where allowed
                          by the role.
                      name:
                        type: string
                      tool_call_id:
                        type: string
                      tool_calls:
                        type: array
                        items:
                          type: object
                          properties: {}
                          additionalProperties: {}
                    required:
                      - role
                    additionalProperties: {}
                metadata:
                  type: object
                  properties:
                    gen_ai.conversation.id:
                      description: >-
                        OpenTelemetry conversation identifier. Selects sticky
                        routing and groups the conversation in W&B Weave.
                      type: string
                      minLength: 1
                    forge.project_version:
                      description: >-
                        Project version to route to, such as `"2"`. Requires
                        `OpenAI-Project`. Omit for version 1.
                      anyOf:
                        - type: string
                          maxLength: 10
                          pattern: ^[1-9]\d*$
                        - type: integer
                          minimum: 1
                          maximum: 2147483647
                    forge.turn_index:
                      description: >-
                        Trusted source turn index used during replay and dataset
                        reconstruction.
                      type: integer
                      minimum: 0
                      maximum: 9007199254740991
                    forge.call_shadow:
                      description: >-
                        Request a Call shadow for task-routed span logging; when
                        added, it creates duplicate trace storage.
                      type: boolean
                    user.id:
                      description: End-user identity attached to the trace.
                      type: string
                      minLength: 1
                  additionalProperties: {}
                stream:
                  default: false
                  type: boolean
                temperature:
                  type: number
                tools:
                  type: array
                  items:
                    type: object
                    properties: {}
                    additionalProperties: {}
                tool_choice: {}
                response_format:
                  type: object
                  properties: {}
                  additionalProperties: {}
                reasoning_effort:
                  type: string
                max_tokens:
                  type: integer
                  minimum: 1
                  maximum: 9007199254740991
                max_completion_tokens:
                  type: integer
                  minimum: 1
                  maximum: 9007199254740991
              required:
                - messages
              additionalProperties: {}
      responses:
        '200':
          description: >-
            Provider response. Streaming requests return server-sent events and
            end with `[DONE]`.
          headers:
            x-proxy-request-id:
              description: Request identifier for support and trace correlation.
              schema:
                type: string
                format: uuid
            Forge-Cache-Status:
              description: >-
                Exact-response cache result. Present only when the request
                enables cache reads.
              schema:
                type: string
                enum:
                  - hit
                  - miss
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  object:
                    type: string
                  created:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  model:
                    type: string
                  choices:
                    type: array
                    items:
                      type: object
                      properties:
                        index:
                          type: integer
                          minimum: -9007199254740991
                          maximum: 9007199254740991
                        message:
                          type: object
                          properties: {}
                          additionalProperties: {}
                        finish_reason:
                          anyOf:
                            - type: string
                            - type: 'null'
                      additionalProperties: {}
                  usage:
                    type: object
                    properties: {}
                    additionalProperties: {}
                additionalProperties: {}
            text/event-stream:
              schema:
                type: string
        '400':
          $ref: '#/components/responses/ProxyError'
        '401':
          $ref: '#/components/responses/ProxyError'
        '403':
          $ref: '#/components/responses/ProxyError'
        '404':
          $ref: '#/components/responses/ProxyError'
        '500':
          $ref: '#/components/responses/ProxyError'
        '502':
          $ref: '#/components/responses/ProxyError'
components:
  responses:
    ProxyError:
      description: >-
        Proxy-generated error. A provider-generated error retains the provider's
        status and response body.
      headers:
        x-proxy-request-id:
          description: Request identifier for support and trace correlation.
          schema:
            type: string
            format: uuid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ProxyError'
  schemas:
    ProxyError:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
              const: proxy_error
          required:
            - message
            - type
          additionalProperties: false
      required:
        - error
      additionalProperties: false
  securitySchemes:
    WandbApiKey:
      type: http
      scheme: bearer
      bearerFormat: W&B API key
      description: >-
        W&B API key whose personal/default entity or teams own the selected task
        and providers.

````