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

# Match Deployment Shape Versions

> Returns the deployment shape versions compatible with the provided deployment create request. Use this to discover a validated shape before creating a deployment with `deployment_shape` set - shapeless deployments (raw accelerator type/count) skip validated-configuration checks and are far more likely to fail at creation.

Use this endpoint to discover the deployment shape versions compatible with a model before creating a deployment. Pass a [Create Deployment](/api-reference/create-deployment) request in the body — at minimum `createDeploymentRequest.deployment.baseModel` — and the response returns the latest validated shape versions that can serve that model, ready to pass as `deploymentShape`.

Match applies the full server-side compatibility logic for you: PEFT base-model resolution (for LoRA addons and live merge, shapes are matched against the PEFT base model), model-type and parameter-count tiers, embedding vs. non-embedding models, the MULTI\_LORA capability gate when `enableAddons` is set, and hiding of FP4 shapes for full-parameter fine-tunes. [List Deployment Shape Versions](/api-reference/list-deployment-shape-versions) only lists versions of a shape you already know and cannot answer "which shapes work with this model?" — use Match for that.

<Note>
  The account in the URL must be **your own account** — the account that will own the deployment (you must be a member of it, so `accounts/fireworks` fails with a permission error). The model in the request body, however, can live in any account you can deploy from, including publisher accounts like `accounts/fireworks`; public shapes from the publisher's account flow into the results.
</Note>

## Example: Match shapes for a model

```bash theme={null}
curl -X POST "https://api.fireworks.ai/v1/accounts/YOUR_ACCOUNT_ID/deploymentShapeVersions:match" \
  -H "Authorization: Bearer $FIREWORKS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "createDeploymentRequest": {
      "deployment": {
        "baseModel": "accounts/fireworks/models/gpt-oss-120b"
      }
    }
  }'
```

To match shapes for a deployment with LoRA addons enabled, include `enableAddons` in the request — only shapes with the MULTI\_LORA capability are returned:

```bash theme={null}
curl -X POST "https://api.fireworks.ai/v1/accounts/YOUR_ACCOUNT_ID/deploymentShapeVersions:match" \
  -H "Authorization: Bearer $FIREWORKS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "createDeploymentRequest": {
      "deployment": {
        "baseModel": "accounts/fireworks/models/gpt-oss-120b",
        "enableAddons": true
      }
    }
  }'
```

Then pass one of the returned shape versions as `deploymentShape` in the [Create Deployment](/api-reference/create-deployment) request. See [What is a deployment shape?](/faq-new/deployment-infrastructure/what-is-a-deployment-shape) for why you should always create deployments from a shape.


## OpenAPI

````yaml post /v1/accounts/{account_id}/deploymentShapeVersions:match
openapi: 3.1.0
info:
  title: Gateway REST API
  version: 5.10.0
servers:
  - url: https://api.fireworks.ai
security:
  - BearerAuth: []
tags:
  - name: AccountService
  - name: DeploymentService
  - name: Gateway
  - name: ModelService
  - name: TrainingService
paths:
  /v1/accounts/{account_id}/deploymentShapeVersions:match:
    post:
      tags:
        - Gateway
      summary: Match Deployment Shape Versions
      description: >-
        Returns the deployment shape versions compatible with the provided
        deployment create request. Use this to discover a validated shape before
        creating a deployment with `deployment_shape` set - shapeless
        deployments (raw accelerator type/count) skip validated-configuration
        checks and are far more likely to fail at creation.
      operationId: Gateway_MatchDeploymentShapeVersions
      parameters:
        - name: account_id
          in: path
          required: true
          description: The Account Id
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/gatewayGatewayMatchDeploymentShapeVersionsBody
        description: The deployment create request to match deployment shape versions for.
        required: true
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/gatewayListDeploymentShapeVersionsResponse
components:
  schemas:
    gatewayGatewayMatchDeploymentShapeVersionsBody:
      type: object
      properties:
        createDeploymentRequest:
          type: object
          description: >-
            The deployment create request to match deployment shape versions
            for. The full CreateDeploymentRequest schema is accepted here —
            including fields like `deployment.enableAddons` that affect shape
            compatibility — only the most common fields are listed below. See
            the Create Deployment reference page for the complete request
            schema.
          properties:
            deployment:
              type: object
              description: The properties of the deployment being created.
              properties:
                baseModel:
                  type: string
                  description: The base model the deployment will serve.
                enableAddons:
                  type: boolean
                  description: >-
                    If true, the deployment can serve LoRA addons. When set,
                    only shapes with the MULTI_LORA capability are returned.
      required:
        - createDeploymentRequest
    gatewayListDeploymentShapeVersionsResponse:
      type: object
      properties:
        deploymentShapeVersions:
          type: array
          items:
            $ref: '#/components/schemas/gatewayDeploymentShapeVersion'
            type: object
        nextPageToken:
          type: string
          description: >-
            A token, which can be sent as `page_token` to retrieve the next
            page.

            If this field is omitted, there are no subsequent pages.
        totalSize:
          type: integer
          format: int32
          description: The total number of deployment shape versions.
    gatewayDeploymentShapeVersion:
      type: object
      properties:
        name:
          type: string
          title: >-
            The resource name of the deployment shape version. e.g.
            accounts/my-account/deploymentShapes/my-deployment-shape/versions/{version_id}
          readOnly: true
        createTime:
          type: string
          format: date-time
          description: >-
            The creation time of the deployment shape version. Lists will be
            ordered by this field.
          readOnly: true
        snapshot:
          $ref: '#/components/schemas/gatewayDeploymentShape'
          description: Full snapshot of the Deployment Shape at this version.
          readOnly: true
        validated:
          type: boolean
          description: If true, this version has been validated.
        public:
          type: boolean
          description: If true, this version will be publicly readable.
        latestValidated:
          type: boolean
          description: |-
            If true, this version is the latest validated version.
            Only one version of the shape can be the latest validated version.
          readOnly: true
        capabilities:
          type: array
          items:
            $ref: '#/components/schemas/DeploymentShapeVersionCapability'
          description: The capabilities supported by this deployment shape version.
      title: >-
        A deployment shape version is a specific version of a deployment shape.

        Versions are immutable, only created on updates and deleted when the
        deployment shape is deleted.
    gatewayDeploymentShape:
      type: object
      properties:
        name:
          type: string
          title: >-
            The resource name of the deployment shape. e.g.
            accounts/my-account/deploymentShapes/my-deployment-shape
          readOnly: true
        displayName:
          type: string
          description: >-
            Human-readable display name of the deployment shape. e.g. "My
            Deployment Shape"

            Must be fewer than 64 characters long.
        description:
          type: string
          description: >-
            The description of the deployment shape. Must be fewer than 1000
            characters long.
        createTime:
          type: string
          format: date-time
          description: The creation time of the deployment shape.
          readOnly: true
        updateTime:
          type: string
          format: date-time
          description: The update time for the deployment shape.
          readOnly: true
        baseModel:
          type: string
          description: >-
            Mutable, but only via UpdateDeploymentShape and only to a compatible
            model:

            one with the same model_type, parameter_count, and embedding status.
            The

            derived model_type / parameter_count fields (OUTPUT_ONLY, IMMUTABLE)
            are

            therefore preserved across a swap. Any incompatible change is
            rejected.
          title: The base model name. e.g. accounts/fireworks/models/falcon-7b
        modelType:
          type: string
          description: The model type of the base model.
          readOnly: true
        parameterCount:
          type: string
          format: int64
          description: The parameter count of the base model .
          readOnly: true
        acceleratorCount:
          type: integer
          format: int32
          description: >-
            The number of accelerators used per replica.

            If not specified, the default is the estimated minimum required by
            the base model.
        acceleratorType:
          $ref: '#/components/schemas/gatewayAcceleratorType'
          description: |-
            The type of accelerator to use.
            If not specified, the default is NVIDIA_A100_80GB.
        precision:
          $ref: '#/components/schemas/DeploymentPrecision'
          description: The precision with which the model should be served.
        disableDeploymentSizeValidation:
          type: boolean
          description: If true, the deployment size validation is disabled.
        enableAddons:
          type: boolean
          description: >-
            If true, LORA addons are enabled for deployments created from this
            shape.

            Deprecated: set enable_addons on the deployment instead.
        draftTokenCount:
          type: integer
          format: int32
          description: |-
            The number of candidate tokens to generate per step for speculative
            decoding.
            Default is the base model's draft_token_count.
        draftModel:
          type: string
          description: >-
            The draft model name for speculative decoding. e.g.
            accounts/fireworks/models/my-draft-model

            If empty, speculative decoding using a draft model is disabled.

            Default is the base model's default_draft_model.

            Deprecated: set default_draft_model on the base model instead.
        ngramSpeculationLength:
          type: integer
          format: int32
          description: >-
            The length of previous input sequence to be considered for N-gram
            speculation.
        disableSpeculativeDecoding:
          type: boolean
          description: >-
            DEPRECATED: This field is a no-op. Speculative decoding is
            configured on deployment.
        enableSessionAffinity:
          type: boolean
          description: Whether to apply sticky routing based on `user` field.
        numLoraDeviceCached:
          type: integer
          format: int32
          title: How many LORA adapters to keep on GPU side for caching
        maxContextLength:
          type: integer
          format: int32
          description: >-
            The maximum context length supported by the model (context window).

            If set to 0 or not specified, the model's default maximum context
            length will be used.
        presetType:
          $ref: '#/components/schemas/DeploymentShapePresetType'
          description: Type of deployment shape for different deployment configurations.
      title: >-
        A deployment shape is a set of parameters that define the shape of a
        deployment.

        Deployments are created from a deployment shape.
      required:
        - baseModel
    DeploymentShapeVersionCapability:
      type: string
      enum:
        - CAPABILITY_UNSPECIFIED
        - MULTI_LORA
      default: CAPABILITY_UNSPECIFIED
      description: A capability that a deployment shape version supports.
    gatewayAcceleratorType:
      type: string
      enum:
        - ACCELERATOR_TYPE_UNSPECIFIED
        - NVIDIA_A100_80GB
        - NVIDIA_H100_80GB
        - AMD_MI300X_192GB
        - NVIDIA_A10G_24GB
        - NVIDIA_A100_40GB
        - NVIDIA_L4_24GB
        - NVIDIA_H200_141GB
        - NVIDIA_B200_180GB
        - AMD_MI325X_256GB
        - AMD_MI350X_288GB
        - NVIDIA_B300_288GB
        - NVIDIA_GB200
        - NVIDIA_GB300
      default: ACCELERATOR_TYPE_UNSPECIFIED
    DeploymentPrecision:
      type: string
      enum:
        - PRECISION_UNSPECIFIED
        - FP16
        - FP8
        - FP8_MM
        - FP8_AR
        - FP8_MM_KV_ATTN
        - FP8_KV
        - FP8_MM_V2
        - FP8_V2
        - FP8_MM_KV_ATTN_V2
        - NF4
        - FP4
        - BF16
        - FP4_BLOCKSCALED_MM
        - FP4_MX_MOE
      default: PRECISION_UNSPECIFIED
      title: >-
        - PRECISION_UNSPECIFIED: if left unspecified we will treat this as a
        legacy model created before

        self serve
    DeploymentShapePresetType:
      type: string
      enum:
        - PRESET_TYPE_UNSPECIFIED
        - MINIMAL
        - FAST
        - THROUGHPUT
        - FULL_PRECISION
        - AGENTIC_CODING
        - CHAT
        - SUMMARIZATION
        - MULTI_LORA
      default: PRESET_TYPE_UNSPECIFIED
      title: |-
        - MINIMAL: Preset for cheapest & most minimal type of deployment
         - FAST: Preset for fastest generation & TTFT deployment
         - THROUGHPUT: Preset for best throughput deployment
         - FULL_PRECISION: Preset for deployment with full precision for training & most accurate numerics
         - AGENTIC_CODING: Preset for autonomous code generation and analysis for development workflows
         - CHAT: Preset for interactive conversational AI for customer engagement
         - SUMMARIZATION: Preset for efficient document and content summarization
         - MULTI_LORA: Preset for multi-LORA serving (deployments that can enable LORA addons)
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer authentication using your Fireworks API key. Format: Bearer
        <API_KEY>
      bearerFormat: API_KEY

````