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

# Create Tuning

> This endpoint creates an index for an app.

### Auth Headers

<ParamField required header="x-metal-api-key" type="string">
  An API key for your org.
</ParamField>

<ParamField required header="x-metal-client-id" type="string">
  A Client ID for your org.
</ParamField>

### Params

<ParamField required path="appId" type="string">
  The App ID
</ParamField>

### Body

<ParamField body="idA" type="string" placeholder="Embedding ID A" required>
  Embedding ID A
</ParamField>

<ParamField body="idB" type="string" placeholder="Embedding ID B" required>
  Embedding ID B
</ParamField>

<ParamField body="label" type="number" placeholder="Score result. Either -1, 0, or 1" required>
  Closeness score. Either `-1`, `0`, or `1`
</ParamField>

### Response

<ResponseField name="data" type="Tuning Object">
  <Expandable title="properties">
    <ResponseField name="id" type="string">
      Id of the Tuning
    </ResponseField>

    <ResponseField name="app" type="string">
      Id of the app for the Tuning
    </ResponseField>

    <ResponseField name="idA" type="string">
      Embedding ID A
    </ResponseField>

    <ResponseField name="idB" type="string">
      Embedding ID B
    </ResponseField>

    <ResponseField name="label" type="string">
      The score label. Either `-1`, `0`, or `1`
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash Example Request theme={null}
  curl --location --request POST 'https://api.getmetal.io/v1/apps/{appId}/tunings' \
  --header 'Content-Type: application/json' \
  --header 'x-metal-api-key: <api-key>' \
  --header 'x-metal-client-id: <client-id>' \
  --data-raw '{
      "idA": "embedding-1",
      "idB": "embedding-2",
      "label": -1
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "data": {
      "id": "1",
      "app": "app-123",
      "idA": "embedding-1",
      "idB": "embedding-2",
      "label": -1
    }
  }
  ```
</ResponseExample>
