v51

latestOpenAPI 3.0.0Apache 2.0raw.githubusercontent.com2026-08-011534301009.2 KB
Product Catalog

Create feature

Features are either metered or static. A feature is metered if meterSlug is provided at creation. For metered features you can pass additional filters that will be applied when calculating feature usage, based on the meter's groupBy fields. Meters with SUM, COUNT, UNIQUE_COUNT and LATEST aggregations are supported for features.

post/api/v1/features

Request body

keystring required

A key is a unique string that is used to identify a resource.

namestring required
metadataMetadata

Set of key-value pairs. Metadata can be used to store additional information about a resource.

meterSlugstring

A key is a unique string that is used to identify a resource.

meterGroupByFiltersobject

Optional meter group by filters. Useful if the meter scope is broader than what feature tracks. Example scenario would be a meter tracking all token use with groupBy fields for the model, then the feature could filter for model=gpt-4.

⚠️ Deprecated: Use advancedMeterGroupByFilters instead

advancedMeterGroupByFiltersobject

Optional advanced meter group by filters. You can use this to filter for values of the meter groupBy fields.

Example request

{
  "metadata": {
    "externalId": "019142cc-a016-796a-8113-1a942fecd26d"
  },
  "meterSlug": "tokens_total",
  "meterGroupByFilters": {
    "model": "gpt-4",
    "type": "input"
  },
  "advancedMeterGroupByFilters": {
    "model": {
      "$in": [
        "gpt-4",
        "gpt-4o"
      ]
    },
    "type": {
      "$eq": "input"
    }
  }
}

Response

The request has succeeded and a new resource has been created as a result.

createdAtstring date-time required

Timestamp of when the resource was created.

updatedAtstring date-time required

Timestamp of when the resource was last updated.

deletedAtstring date-time

Timestamp of when the resource was permanently deleted.

archivedAtstring date-time

Timestamp of when the resource was archived.

keystring required

A key is a unique string that is used to identify a resource.

namestring required
metadataMetadata

Set of key-value pairs. Metadata can be used to store additional information about a resource.

meterSlugstring

A key is a unique string that is used to identify a resource.

meterGroupByFiltersobject

Optional meter group by filters. Useful if the meter scope is broader than what feature tracks. Example scenario would be a meter tracking all token use with groupBy fields for the model, then the feature could filter for model=gpt-4.

⚠️ Deprecated: Use advancedMeterGroupByFilters instead

advancedMeterGroupByFiltersobject

Optional advanced meter group by filters. You can use this to filter for values of the meter groupBy fields.

idstring required

Readonly unique ULID identifier.

Example response

{
  "createdAt": "2024-01-01T01:01:01.001Z",
  "updatedAt": "2024-01-01T01:01:01.001Z",
  "deletedAt": "2024-01-01T01:01:01.001Z",
  "archivedAt": "2023-01-01T01:01:01.001Z",
  "metadata": {
    "externalId": "019142cc-a016-796a-8113-1a942fecd26d"
  },
  "meterSlug": "tokens_total",
  "meterGroupByFilters": {
    "model": "gpt-4",
    "type": "input"
  },
  "advancedMeterGroupByFilters": {
    "model": {
      "$in": [
        "gpt-4",
        "gpt-4o"
      ]
    },
    "type": {
      "$eq": "input"
    }
  },
  "id": "01ARZ3NDEKTSV4RRFFQ69G5FAV"
}