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

# Supprimer un modèle

> Supprime en douceur (soft-delete) l'un des modèles de ton organisation.

Supprime en douceur (soft-delete) un modèle appartenant à ton organisation — il cesse d'apparaître dans l'app et
l'API et renvoie **`204 No Content`**. Les modèles inconnus, appartenant à une autre organisation,
déjà supprimés ou internes renvoient
[`404 not_found`](/fr/guides/errors#not_found). Nécessite le scope `models.write`.

<Warning>
  La suppression est un soft-delete mais n'est pas réversible via l'API. Un modèle utilisé par
  des presets enregistrés ou des automatisations ne sera plus composable une fois supprimé.
</Warning>


## OpenAPI

````yaml api-reference/openapi.json DELETE /models/{model_id}
openapi: 3.1.0
info:
  title: Samsa API
  description: >-
    The Samsa public REST API. Authenticate with an organization API key as a
    bearer token (`Authorization: Bearer samsa_sk_...`). Errors follow a single
    envelope shape; every response carries an `X-Request-ID`.
  version: 1.0.0
servers:
  - url: https://api.samsa.ai/public/v1
security:
  - BearerAuth: []
paths:
  /models/{model_id}:
    delete:
      tags:
        - Models
      summary: Delete one of your models
      description: >-
        Soft-deletes a model you own (including your own `private` models) or a
        non-private model shared within your organization — it stops appearing
        in the app and the API. Another user's private model, another
        organization's model, a Samsa default/library model, or an
        already-deleted / internal model returns `404`; a successful delete
        returns `204` with no body. Requires the `models.write` scope.
      operationId: delete_model_models__model_id__delete
      parameters:
        - name: model_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Model Id
      responses:
        '204':
          description: Model soft-deleted.
        '401':
          description: Missing, invalid, expired, or revoked API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '403':
          description: The API key lacks the required scope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '404':
          description: >-
            Model not found (unknown id, another user's private model, another
            organization, a Samsa default/library model, deleted, or not
            public). Your own models — including your private ones — and
            non-private models in your organization are accessible.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '422':
          description: Request validation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '429':
          description: Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
components:
  schemas:
    ErrorEnvelope:
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetail'
      type: object
      required:
        - error
      title: ErrorEnvelope
      description: The complete public error body — an ``error`` object wrapper (ADR §5).
    ErrorDetail:
      properties:
        type:
          type: string
          title: Type
          examples:
            - authentication_error
        code:
          type: string
          title: Code
          examples:
            - invalid_api_key
        message:
          type: string
          title: Message
          examples:
            - The provided API key is invalid, expired, or revoked.
        request_id:
          type: string
          title: Request Id
          examples:
            - 8f14e45fceea167a5a36dedd4bea2543
        param:
          anyOf:
            - type: string
            - type: 'null'
          title: Param
          description: Present on validation errors — names the offending field.
          examples:
            - aspect_ratio
      type: object
      required:
        - type
        - code
        - message
        - request_id
      title: ErrorDetail
      description: The ``error`` object of the public envelope (ADR §5).
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Organization API key as a bearer token: `Authorization: Bearer
        samsa_sk_...`.

````