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

# Add tags to scorers using API instead of SDK

export const plans_0 = "Any"

export const deployments_0 = "Any"

export const data_plane_version_0 = undefined

export const use_case_0 = undefined

<Note>
  **Applies to:**

  * Plan - {plans_0}
  * Deployment - {deployments_0}
  * {data_plane_version_0}
  * {use_case_0}
</Note>

## Summary

**Goal:** Add tags to functions created via SDK by using the API directly.

**Features:** Create Function API endpoint supports tags while SDK Builder classes do not.

## Configuration Steps

### Step 1: Use the Create Function API endpoint

###

When creating a function via the API, you can include a `tags` array in the request body. This is not currently possible when using SDK builder helpers.

**Create Function Endpoint**

```text theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
POST https://api.braintrust.dev/v1/function

```

### Step 2: Make a POST request to the Create Function endpoint

Include the `tags` parameter in your request body.

```python theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
import requests

api_key = "YOUR_API_KEY"

response = requests.post(
    "https://api.braintrust.dev/v1/function",
    headers={
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json",
    },
    json={
        "project_id": "your-project-id",
        "function_data": {
            "type": "scorer",
            "name": "my-scorer",
        },
        "tags": ["production", "v1"],
    },
)

response.raise_for_status()
print(response.json())

```

### Step 3: TypeScript example

Same approach for TypeScript users.

```javascript theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
const apiKey = "YOUR_API_KEY";

const response = await fetch("https://api.braintrust.dev/v1/function", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    project_id: "your-project-id",
    function_data: {
      type: "scorer",
      name: "my-scorer",
    },
    tags: ["production", "v1"],
  }),
});

if (!response.ok) {
  throw new Error(`Request failed: ${response.status} ${response.statusText}`);
}

const data = await response.json();
console.log(data);

```
