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

# Add a LoRA adapter to an endpoint

> Adds a LoRA adapter model to a dedicated endpoint. After this call,
inference requests to the adapter model name will be routed to the
specified endpoint. The endpoint must have LoRA enabled, and the
adapter's base model must be compatible with the endpoint's model.
The endpoint name prefix in model_id must match the resolved endpoint.




## OpenAPI

````yaml POST /endpoints/{endpointId}/adapters
openapi: 3.1.0
info:
  title: Together APIs
  description: The Together REST API. See https://docs.together.ai for more details.
  version: 2.0.0
  termsOfService: https://www.together.ai/terms-of-service
  contact:
    name: Together Support
    url: https://www.together.ai/contact
  license:
    name: MIT
    url: https://github.com/togethercomputer/openapi/blob/main/LICENSE
servers:
  - url: https://api.together.ai/v1
security:
  - bearerAuth: []
paths:
  /endpoints/{endpointId}/adapters:
    parameters:
      - name: endpointId
        in: path
        required: true
        schema:
          type: string
        description: The endpoint ID
    post:
      tags:
        - Endpoints
      summary: Add a LoRA adapter to an endpoint
      description: |
        Adds a LoRA adapter model to a dedicated endpoint. After this call,
        inference requests to the adapter model name will be routed to the
        specified endpoint. The endpoint must have LoRA enabled, and the
        adapter's base model must be compatible with the endpoint's model.
        The endpoint name prefix in model_id must match the resolved endpoint.
      operationId: addAdapter
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model_id
              properties:
                model_id:
                  type: string
                  description: >-
                    Combined identifier in format
                    "endpoint_name:adapter_model_name".
                  example: >-
                    username/Meta-Llama-3.1-8B-Instruct-def456:username/my-adapter-abc123
      responses:
        '200':
          description: Adapter successfully bound to endpoint
          content:
            application/json:
              schema:
                type: object
                properties:
                  model_id:
                    type: string
        '400':
          description: >-
            Bad Request — invalid model_id format, endpoint name mismatch, LoRA
            not enabled, incompatible base model, or adapter already bound
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '403':
          description: Forbidden — adapter model not found or not owned
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '404':
          description: Not Found — endpoint does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
      x-codeSamples:
        - lang: Python
          label: Together AI SDK (v2)
          source: |
            from together import Together
            import os

            client = Together(
                api_key=os.environ.get("TOGETHER_API_KEY"),
            )

            result = client.endpoints.adapters.add(
                "endpoint-abc123",
                model_id="username/my-endpoint-name:username/my-adapter-model",
            )
            print(result.api_model_id)
        - lang: TypeScript
          label: Together AI SDK (TypeScript)
          source: >
            import Together from "together-ai";


            const client = new Together({
              apiKey: process.env.TOGETHER_API_KEY,
            });


            const result = await
            client.endpoints.adapters.add("endpoint-abc123", {
              model_id: "username/my-endpoint-name:username/my-adapter-model",
            });

            console.log(result.model_id);
        - lang: JavaScript
          label: Together AI SDK (JavaScript)
          source: >
            import Together from "together-ai";


            const client = new Together({
              apiKey: process.env.TOGETHER_API_KEY,
            });


            const result = await
            client.endpoints.adapters.add("endpoint-abc123", {
              model_id: "username/my-endpoint-name:username/my-adapter-model",
            });

            console.log(result.model_id);
        - lang: Shell
          label: cURL
          source: >
            curl -X POST
            "https://api.together.ai/v1/endpoints/endpoint-abc123/adapters" \
                 -H "Authorization: Bearer $TOGETHER_API_KEY" \
                 -H "Content-Type: application/json" \
                 -d '{"model_id": "username/my-endpoint-name:username/my-adapter-model"}'
components:
  schemas:
    ErrorData:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              nullable: false
            type:
              type: string
              nullable: false
            param:
              type: string
              nullable: true
              default: null
            code:
              type: string
              nullable: true
              default: null
          required:
            - type
            - message
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      x-bearer-format: bearer
      x-default: default

````