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

# Create Feature

> Creates a new feature.

Use this to programmatically create features for metering usage, managing access, or building credit systems.

export const DynamicResponseExample = ({json, statusCode = "200"}) => {
  const toCamelCase = str => {
    return str.replace(/_([a-z])/g, (_, c) => c.toUpperCase());
  };
  const convertKeysToCamelCase = obj => {
    if (Array.isArray(obj)) {
      return obj.map(item => convertKeysToCamelCase(item));
    }
    if (obj !== null && typeof obj === "object") {
      return Object.keys(obj).reduce((acc, key) => {
        const camelKey = toCamelCase(key);
        acc[camelKey] = convertKeysToCamelCase(obj[key]);
        return acc;
      }, {});
    }
    return obj;
  };
  const [isTypeScript, setIsTypeScript] = useState(() => {
    if (typeof window !== "undefined") {
      try {
        const lang = localStorage.getItem("code");
        return JSON.parse(lang) === "typescript";
      } catch {
        return true;
      }
    }
    return true;
  });
  useEffect(() => {
    const onMintlifyStorage = event => {
      if (event.detail?.key === "code") {
        try {
          const value = JSON.parse(event.detail.value);
          setIsTypeScript(value === "typescript");
        } catch {}
      }
    };
    const pollInterval = setInterval(() => {
      try {
        const lang = localStorage.getItem("code");
        const value = JSON.parse(lang);
        setIsTypeScript(value === "typescript");
      } catch {}
    }, 300);
    document.addEventListener("mintlify-localstorage", onMintlifyStorage);
    return () => {
      document.removeEventListener("mintlify-localstorage", onMintlifyStorage);
      clearInterval(pollInterval);
    };
  }, []);
  const camelCaseJson = useMemo(() => convertKeysToCamelCase(json), [json]);
  const snakeCaseString = JSON.stringify(json, null, 2);
  const camelCaseString = JSON.stringify(camelCaseJson, null, 2);
  return <ResponseExample>
			{isTypeScript ? <CodeBlock language="json" filename={statusCode}>
					{camelCaseString}
				</CodeBlock> : <CodeBlock language="json" filename={statusCode}>
					{snakeCaseString}
				</CodeBlock>}
		</ResponseExample>;
};

export const DynamicResponseField = ({children, name, ...props}) => {
  const convertToCamelCase = str => {
    if (typeof str !== "string") return str;
    return str.replace(/[_-](\w)/g, (_, c) => c.toUpperCase());
  };
  const [lang, setLang] = useState(() => {
    if (typeof window !== "undefined") {
      const stored = localStorage.getItem("code");
      return stored || '"typescript"';
    }
    return '"typescript"';
  });
  useEffect(() => {
    const onMintlifyStorage = event => {
      const key = event.detail?.key;
      if (key === "code") {
        setLang(event.detail.value);
      }
    };
    const pollInterval = setInterval(() => {
      const current = localStorage.getItem("code");
      if (current && current !== lang) {
        setLang(current);
      }
    }, 500);
    document.addEventListener("mintlify-localstorage", onMintlifyStorage);
    return () => {
      document.removeEventListener("mintlify-localstorage", onMintlifyStorage);
      clearInterval(pollInterval);
    };
  }, [lang]);
  const resolvedName = useMemo(() => {
    try {
      const value = JSON.parse(lang);
      const useCamelCase = value === "typescript";
      return useCamelCase ? convertToCamelCase(name) : name;
    } catch {
      return name;
    }
  }, [name, lang]);
  return <ResponseField name={resolvedName} {...props}>
			{children}
		</ResponseField>;
};

export const DynamicParamField = ({children, body, path, ...props}) => {
  const convertToCamelCase = str => {
    if (typeof str !== "string") return str;
    return str.replace(/[_-](\w)/g, (_, c) => c.toUpperCase());
  };
  const [lang, setLang] = useState(() => {
    if (typeof window !== "undefined") {
      const stored = localStorage.getItem("code");
      return stored || '"typescript"';
    }
    return '"typescript"';
  });
  useEffect(() => {
    const onMintlifyStorage = event => {
      const key = event.detail?.key;
      if (key === "code") {
        setLang(event.detail.value);
      }
    };
    const pollInterval = setInterval(() => {
      const current = localStorage.getItem("code");
      if (current && current !== lang) {
        setLang(current);
      }
    }, 500);
    document.addEventListener("mintlify-localstorage", onMintlifyStorage);
    return () => {
      document.removeEventListener("mintlify-localstorage", onMintlifyStorage);
      clearInterval(pollInterval);
    };
  }, [lang]);
  const resolvedBody = useMemo(() => {
    try {
      const value = JSON.parse(lang);
      const useCamelCase = value === "typescript";
      return useCamelCase ? convertToCamelCase(body) : body;
    } catch {
      return body;
    }
  }, [body, lang]);
  const resolvedPath = useMemo(() => {
    try {
      const value = JSON.parse(lang);
      const useCamelCase = value === "typescript";
      return useCamelCase ? convertToCamelCase(path) : path;
    } catch {
      return path;
    }
  }, [path, lang]);
  return <ParamField body={resolvedBody} path={resolvedPath} {...props}>
			{children}
		</ParamField>;
};

### Body Parameters

<DynamicParamField body="name" type="string" required>
  The name of the feature.
</DynamicParamField>

<DynamicParamField body="type" type="'boolean' | 'metered' | 'credit_system' | 'ai_credit_system'" required>
  The type of the feature. 'single\_use' features are consumed, like API calls, tokens, or messages. 'continuous\_use' features are allocated, like seats, workspaces, or projects. 'credit\_system' features are schemas that unify multiple 'single\_use' features into a single credit system.
</DynamicParamField>

<DynamicParamField body="consumable" type="boolean">
  Whether this feature is consumable. A consumable feature is one that periodically resets and is consumed rather than allocated (like credits, API requests, etc.). Applicable only for 'metered' features.
</DynamicParamField>

<DynamicParamField body="display" type="object">
  Singular and plural display names for the feature in your user interface.

  <Expandable title="properties">
    <DynamicParamField body="singular" type="string" required />

    <DynamicParamField body="plural" type="string" required />
  </Expandable>
</DynamicParamField>

<DynamicParamField body="credit_schema" type="object | object[]">
  A schema that maps metered feature IDs to flat or graduated credit costs. For classic credit systems only — AI credit systems use model\_markups instead.

  <Expandable title="properties">
    <DynamicParamField body="metered_feature_id" type="string">
      ID of the metered feature that draws from this credit system.
    </DynamicParamField>

    <DynamicParamField body="billing_units" type="number">
      Number of metered-feature units priced together. Defaults to one when omitted.
    </DynamicParamField>

    <DynamicParamField body="dimensions.{key}" type="object">
      Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.

      <Expandable title="properties">
        <DynamicParamField body="match.{key}" type="string" required>
          Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
        </DynamicParamField>

        <DynamicParamField body="priority" type="integer">
          Breaks ties between dimensions that match the same number of keys. Higher wins.
        </DynamicParamField>

        <DynamicParamField body="tier_behavior" type="any" required />

        <DynamicParamField body="tiers" type="object[]" required>
          <Expandable title="properties">
            <DynamicParamField body="to" type="number" required>
              Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
            </DynamicParamField>

            <DynamicParamField body="credit_cost" type="number" required>
              Credits consumed per billing-unit group within this tier.
            </DynamicParamField>
          </Expandable>
        </DynamicParamField>
      </Expandable>
    </DynamicParamField>

    <DynamicParamField body="multipliers.{key}" type="object">
      Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.

      <Expandable title="properties">
        <DynamicParamField body="match.{key}" type="string" required>
          Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
        </DynamicParamField>

        <DynamicParamField body="factor" type="number">
          Multiplies the matched rate. All matching multipliers stack.
        </DynamicParamField>

        <DynamicParamField body="add" type="number">
          Added to the rate after every factor is applied, in credits per billing-unit group.
        </DynamicParamField>
      </Expandable>
    </DynamicParamField>

    <DynamicParamField body="tier_behavior" type="any" />

    <DynamicParamField body="tiers" type="object[]">
      <Expandable title="properties">
        <DynamicParamField body="to" type="number" required>
          Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
        </DynamicParamField>

        <DynamicParamField body="credit_cost" type="number" required>
          Credits consumed per billing-unit group within this tier.
        </DynamicParamField>
      </Expandable>
    </DynamicParamField>

    <DynamicParamField body="credit_cost" type="number">
      Credits consumed per billing-unit group.
    </DynamicParamField>
  </Expandable>
</DynamicParamField>

<DynamicParamField body="invoice_credit" type="boolean">
  Whether usage of this classic credit system should be itemized as invoice credits.
</DynamicParamField>

<DynamicParamField body="model_markups.{key}" type="object | null">
  Per-model markup overrides for AI credit systems. Maps model IDs to their markup configuration.

  <Expandable title="properties">
    <DynamicParamField body="markup" type="number" />

    <DynamicParamField body="input_cost" type="number" />

    <DynamicParamField body="output_cost" type="number" />
  </Expandable>
</DynamicParamField>

<DynamicParamField body="default_markup" type="number">
  Default percentage markup for this AI credit system. Used when no model or provider markup applies. Use -100 to make usage free.
</DynamicParamField>

<DynamicParamField body="provider_markups.{key}" type="object | null">
  Per-provider default markup percentages for AI credit systems. Provider keys match the first segment of model\_id.

  <Expandable title="properties">
    <DynamicParamField body="markup" type="number" required />
  </Expandable>
</DynamicParamField>

<DynamicParamField body="event_names" type="string[]" />

<DynamicParamField body="feature_id" type="string" required>
  The ID of the feature to create.
</DynamicParamField>

### Response

<DynamicResponseField name="id" type="string">
  The unique identifier for this feature, used in /check and /track calls.
</DynamicResponseField>

<DynamicResponseField name="name" type="string">
  Human-readable name displayed in the dashboard and billing UI.
</DynamicResponseField>

<DynamicResponseField name="type" type="'boolean' | 'metered' | 'credit_system' | 'ai_credit_system'">
  Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit\_system' for unified credit pools, 'ai\_credit\_system' for model-based token pricing.
</DynamicResponseField>

<DynamicResponseField name="consumable" type="boolean">
  For metered features: true if usage resets periodically (API calls, credits), false if allocated persistently (seats, storage).
</DynamicResponseField>

<DynamicResponseField name="event_names" type="string[]">
  Event names that trigger this feature's balance. Allows multiple features to respond to a single event.
</DynamicResponseField>

<DynamicResponseField name="credit_schema" type="object | object | object[]">
  For classic credit systems: maps metered features to flat or graduated credit costs.

  <Expandable title="properties">
    <DynamicResponseField name="metered_feature_id" type="string | any">
      ID of the metered feature that draws from this credit system.
    </DynamicResponseField>

    <DynamicResponseField name="billing_units" type="number">
      Number of metered-feature units priced together. Defaults to one when omitted.
    </DynamicResponseField>

    <DynamicResponseField name="dimensions.{key}" type="object">
      Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.

      <Expandable title="properties">
        <DynamicResponseField name="match.{key}" type="string">
          Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
        </DynamicResponseField>

        <DynamicResponseField name="priority" type="integer">
          Breaks ties between dimensions that match the same number of keys. Higher wins.
        </DynamicResponseField>

        <DynamicResponseField name="tier_behavior" type="any" />

        <DynamicResponseField name="tiers" type="object[]">
          <Expandable title="properties">
            <DynamicResponseField name="to" type="number">
              Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
            </DynamicResponseField>

            <DynamicResponseField name="credit_cost" type="number">
              Credits consumed per billing-unit group within this tier.
            </DynamicResponseField>
          </Expandable>
        </DynamicResponseField>
      </Expandable>
    </DynamicResponseField>

    <DynamicResponseField name="multipliers.{key}" type="object">
      Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.

      <Expandable title="properties">
        <DynamicResponseField name="match.{key}" type="string">
          Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
        </DynamicResponseField>

        <DynamicResponseField name="factor" type="number">
          Multiplies the matched rate. All matching multipliers stack.
        </DynamicResponseField>

        <DynamicResponseField name="add" type="number">
          Added to the rate after every factor is applied, in credits per billing-unit group.
        </DynamicResponseField>
      </Expandable>
    </DynamicResponseField>

    <DynamicResponseField name="tier_behavior" type="any" />

    <DynamicResponseField name="tiers" type="object[]">
      <Expandable title="properties">
        <DynamicResponseField name="to" type="number">
          Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
        </DynamicResponseField>

        <DynamicResponseField name="credit_cost" type="number">
          Credits consumed per billing-unit group within this tier.
        </DynamicResponseField>
      </Expandable>
    </DynamicResponseField>

    <DynamicResponseField name="credit_cost" type="number">
      Credits consumed per billing-unit group.
    </DynamicResponseField>
  </Expandable>
</DynamicResponseField>

<DynamicResponseField name="invoice_credit" type="boolean">
  Whether usage of this classic credit system should be itemized as invoice credits.
</DynamicResponseField>

<DynamicResponseField name="model_markups.{key}" type="object | null">
  Per-model markup overrides for AI credit systems.

  <Expandable title="properties">
    <DynamicResponseField name="markup" type="number" />

    <DynamicResponseField name="input_cost" type="number" />

    <DynamicResponseField name="output_cost" type="number" />
  </Expandable>
</DynamicResponseField>

<DynamicResponseField name="default_markup" type="number">
  Default percentage markup for AI credit systems. Use -100 to make usage free.
</DynamicResponseField>

<DynamicResponseField name="provider_markups.{key}" type="object | null">
  Per-provider default markup percentages for AI credit systems.

  <Expandable title="properties">
    <DynamicResponseField name="markup" type="number" />
  </Expandable>
</DynamicResponseField>

<DynamicResponseField name="display" type="object">
  Display names for the feature in billing UI and customer-facing components.

  <Expandable title="properties">
    <DynamicResponseField name="singular" type="string | null">
      Singular form for UI display (e.g., 'API call', 'seat').
    </DynamicResponseField>

    <DynamicResponseField name="plural" type="string | null">
      Plural form for UI display (e.g., 'API calls', 'seats').
    </DynamicResponseField>
  </Expandable>
</DynamicResponseField>

<DynamicResponseField name="archived" type="boolean">
  Whether the feature is archived and hidden from the dashboard.
</DynamicResponseField>

<DynamicResponseField name="processors" type="object">
  Processor mappings for this feature. Present when a Stripe product or meter is set.

  <Expandable title="properties">
    <DynamicResponseField name="stripe" type="object">
      <Expandable title="properties">
        <DynamicResponseField name="product_id" type="string">
          Stripe product ID this feature's usage prices bill under.
        </DynamicResponseField>

        <DynamicResponseField name="meter_id" type="string">
          Stripe meter ID used to create this feature's metered price.
        </DynamicResponseField>
      </Expandable>
    </DynamicResponseField>
  </Expandable>
</DynamicResponseField>

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": "api-calls",
    "name": "API Calls",
    "type": "metered",
    "consumable": true,
    "archived": false,
    "display": {
      "singular": "API call",
      "plural": "API calls"
    }
  }
  ```
</ResponseExample>


## OpenAPI

````yaml openapi POST /v1/features.create
openapi: 3.1.0
info:
  title: Autumn API
  version: 2.4.0
servers:
  - url: https://api.useautumn.com
    description: Production server
security:
  - secretKey: []
paths:
  /v1/features.create:
    post:
      tags:
        - features
      description: >-
        Creates a new feature.


        Use this to programmatically create features for metering usage,
        managing access, or building credit systems.
      operationId: createFeature
      parameters:
        - name: x-api-version
          in: header
          required: true
          schema:
            type: string
            default: 2.4.0
          x-speakeasy-globals-hidden: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: The name of the feature.
                type:
                  enum:
                    - boolean
                    - metered
                    - credit_system
                    - ai_credit_system
                  type: string
                  description: >-
                    The type of the feature. 'single_use' features are consumed,
                    like API calls, tokens, or messages. 'continuous_use'
                    features are allocated, like seats, workspaces, or projects.
                    'credit_system' features are schemas that unify multiple
                    'single_use' features into a single credit system.
                consumable:
                  type: boolean
                  description: >-
                    Whether this feature is consumable. A consumable feature is
                    one that periodically resets and is consumed rather than
                    allocated (like credits, API requests, etc.). Applicable
                    only for 'metered' features.
                display:
                  type: object
                  properties:
                    singular:
                      type: string
                    plural:
                      type: string
                  required:
                    - singular
                    - plural
                  description: >-
                    Singular and plural display names for the feature in your
                    user interface.
                credit_schema:
                  type: array
                  items:
                    anyOf:
                      - type: object
                        properties:
                          metered_feature_id:
                            type: string
                            minLength: 1
                            description: >-
                              ID of the metered feature that draws from this
                              credit system.
                          billing_units:
                            type: number
                            exclusiveMinimum: 0
                            description: >-
                              Number of metered-feature units priced together.
                              Defaults to one when omitted.
                          dimensions:
                            type: object
                            propertyNames:
                              type: string
                              minLength: 1
                              maxLength: 64
                            additionalProperties:
                              anyOf:
                                - type: object
                                  properties:
                                    match:
                                      type: object
                                      propertyNames:
                                        type: string
                                      additionalProperties:
                                        anyOf:
                                          - type: string
                                          - type: number
                                          - type: boolean
                                      description: >-
                                        Event properties this entry applies to.
                                        Every key must equal the tracked
                                        property, compared as strings.
                                    priority:
                                      type: integer
                                      minimum: -9007199254740991
                                      maximum: 9007199254740991
                                      description: >-
                                        Breaks ties between dimensions that
                                        match the same number of keys. Higher
                                        wins.
                                    tier_behavior:
                                      const: graduated
                                    tiers:
                                      type: array
                                      minItems: 1
                                      items:
                                        type: object
                                        properties:
                                          to:
                                            anyOf:
                                              - type: number
                                                exclusiveMinimum: 0
                                              - enum:
                                                  - inf
                                                type: string
                                            description: >-
                                              Inclusive upper usage boundary for this
                                              graduated tier. The final tier must be
                                              'inf'.
                                          credit_cost:
                                            type: number
                                            minimum: 0
                                            description: >-
                                              Credits consumed per billing-unit group
                                              within this tier.
                                        required:
                                          - to
                                          - credit_cost
                                  required:
                                    - match
                                    - tier_behavior
                                    - tiers
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    match:
                                      type: object
                                      propertyNames:
                                        type: string
                                      additionalProperties:
                                        anyOf:
                                          - type: string
                                          - type: number
                                          - type: boolean
                                      description: >-
                                        Event properties this entry applies to.
                                        Every key must equal the tracked
                                        property, compared as strings.
                                    priority:
                                      type: integer
                                      minimum: -9007199254740991
                                      maximum: 9007199254740991
                                      description: >-
                                        Breaks ties between dimensions that
                                        match the same number of keys. Higher
                                        wins.
                                    credit_cost:
                                      type: number
                                      minimum: 0
                                      description: >-
                                        Credits consumed per billing-unit group
                                        when this dimension matches.
                                  required:
                                    - match
                                    - credit_cost
                                  additionalProperties: false
                            description: >-
                              Named rates chosen by event properties. The most
                              specific match sets the rate; with no match the
                              item's own rate applies.
                          multipliers:
                            type: object
                            propertyNames:
                              type: string
                              minLength: 1
                              maxLength: 64
                            additionalProperties:
                              type: object
                              properties:
                                match:
                                  type: object
                                  propertyNames:
                                    type: string
                                  additionalProperties:
                                    anyOf:
                                      - type: string
                                      - type: number
                                      - type: boolean
                                  description: >-
                                    Event properties this entry applies to.
                                    Every key must equal the tracked property,
                                    compared as strings.
                                factor:
                                  type: number
                                  exclusiveMinimum: 0
                                  description: >-
                                    Multiplies the matched rate. All matching
                                    multipliers stack.
                                add:
                                  type: number
                                  description: >-
                                    Added to the rate after every factor is
                                    applied, in credits per billing-unit group.
                              required:
                                - match
                              additionalProperties: false
                            description: >-
                              Named adjustments chosen by event properties.
                              Every match applies: factors multiply, then adds
                              are summed.
                          tier_behavior:
                            const: graduated
                          tiers:
                            type: array
                            minItems: 1
                            items:
                              type: object
                              properties:
                                to:
                                  anyOf:
                                    - type: number
                                      exclusiveMinimum: 0
                                    - enum:
                                        - inf
                                      type: string
                                  description: >-
                                    Inclusive upper usage boundary for this
                                    graduated tier. The final tier must be
                                    'inf'.
                                credit_cost:
                                  type: number
                                  minimum: 0
                                  description: >-
                                    Credits consumed per billing-unit group
                                    within this tier.
                              required:
                                - to
                                - credit_cost
                        required:
                          - metered_feature_id
                          - tier_behavior
                          - tiers
                        additionalProperties: false
                      - type: object
                        properties:
                          metered_feature_id:
                            type: string
                            minLength: 1
                            description: >-
                              ID of the metered feature that draws from this
                              credit system.
                          billing_units:
                            type: number
                            exclusiveMinimum: 0
                            description: >-
                              Number of metered-feature units priced together.
                              Defaults to one when omitted.
                          dimensions:
                            type: object
                            propertyNames:
                              type: string
                              minLength: 1
                              maxLength: 64
                            additionalProperties:
                              anyOf:
                                - type: object
                                  properties:
                                    match:
                                      type: object
                                      propertyNames:
                                        type: string
                                      additionalProperties:
                                        anyOf:
                                          - type: string
                                          - type: number
                                          - type: boolean
                                      description: >-
                                        Event properties this entry applies to.
                                        Every key must equal the tracked
                                        property, compared as strings.
                                    priority:
                                      type: integer
                                      minimum: -9007199254740991
                                      maximum: 9007199254740991
                                      description: >-
                                        Breaks ties between dimensions that
                                        match the same number of keys. Higher
                                        wins.
                                    tier_behavior:
                                      const: graduated
                                    tiers:
                                      type: array
                                      minItems: 1
                                      items:
                                        type: object
                                        properties:
                                          to:
                                            anyOf:
                                              - type: number
                                                exclusiveMinimum: 0
                                              - enum:
                                                  - inf
                                                type: string
                                            description: >-
                                              Inclusive upper usage boundary for this
                                              graduated tier. The final tier must be
                                              'inf'.
                                          credit_cost:
                                            type: number
                                            minimum: 0
                                            description: >-
                                              Credits consumed per billing-unit group
                                              within this tier.
                                        required:
                                          - to
                                          - credit_cost
                                  required:
                                    - match
                                    - tier_behavior
                                    - tiers
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    match:
                                      type: object
                                      propertyNames:
                                        type: string
                                      additionalProperties:
                                        anyOf:
                                          - type: string
                                          - type: number
                                          - type: boolean
                                      description: >-
                                        Event properties this entry applies to.
                                        Every key must equal the tracked
                                        property, compared as strings.
                                    priority:
                                      type: integer
                                      minimum: -9007199254740991
                                      maximum: 9007199254740991
                                      description: >-
                                        Breaks ties between dimensions that
                                        match the same number of keys. Higher
                                        wins.
                                    credit_cost:
                                      type: number
                                      minimum: 0
                                      description: >-
                                        Credits consumed per billing-unit group
                                        when this dimension matches.
                                  required:
                                    - match
                                    - credit_cost
                                  additionalProperties: false
                            description: >-
                              Named rates chosen by event properties. The most
                              specific match sets the rate; with no match the
                              item's own rate applies.
                          multipliers:
                            type: object
                            propertyNames:
                              type: string
                              minLength: 1
                              maxLength: 64
                            additionalProperties:
                              type: object
                              properties:
                                match:
                                  type: object
                                  propertyNames:
                                    type: string
                                  additionalProperties:
                                    anyOf:
                                      - type: string
                                      - type: number
                                      - type: boolean
                                  description: >-
                                    Event properties this entry applies to.
                                    Every key must equal the tracked property,
                                    compared as strings.
                                factor:
                                  type: number
                                  exclusiveMinimum: 0
                                  description: >-
                                    Multiplies the matched rate. All matching
                                    multipliers stack.
                                add:
                                  type: number
                                  description: >-
                                    Added to the rate after every factor is
                                    applied, in credits per billing-unit group.
                              required:
                                - match
                              additionalProperties: false
                            description: >-
                              Named adjustments chosen by event properties.
                              Every match applies: factors multiply, then adds
                              are summed.
                          credit_cost:
                            type: number
                            minimum: 0
                            description: Credits consumed per billing-unit group.
                        required:
                          - metered_feature_id
                          - credit_cost
                        additionalProperties: false
                  description: >-
                    A schema that maps metered feature IDs to flat or graduated
                    credit costs. For classic credit systems only — AI credit
                    systems use model_markups instead.
                invoice_credit:
                  type: boolean
                  description: >-
                    Whether usage of this classic credit system should be
                    itemized as invoice credits.
                model_markups:
                  anyOf:
                    - type: object
                      propertyNames:
                        type: string
                        pattern: .+\/.+
                      additionalProperties:
                        type: object
                        properties:
                          markup:
                            type: number
                            minimum: -100
                          input_cost:
                            type: number
                            minimum: 0
                          output_cost:
                            type: number
                            minimum: 0
                    - type: 'null'
                  description: >-
                    Per-model markup overrides for AI credit systems. Maps model
                    IDs to their markup configuration.
                default_markup:
                  type: number
                  minimum: -100
                  description: >-
                    Default percentage markup for this AI credit system. Used
                    when no model or provider markup applies. Use -100 to make
                    usage free.
                provider_markups:
                  anyOf:
                    - type: object
                      propertyNames:
                        type: string
                      additionalProperties:
                        type: object
                        properties:
                          markup:
                            type: number
                            minimum: -100
                        required:
                          - markup
                    - type: 'null'
                  description: >-
                    Per-provider default markup percentages for AI credit
                    systems. Provider keys match the first segment of model_id.
                event_names:
                  type: array
                  items:
                    type: string
                feature_id:
                  type: string
                  description: The ID of the feature to create.
              required:
                - name
                - type
                - feature_id
              title: CreateFeatureParams
              examples:
                - feature_id: api-calls
                  name: API Calls
                  type: metered
                  consumable: true
                - feature_id: credits
                  name: Credits
                  type: credit_system
                  consumable: true
                  credit_schema:
                    - metered_feature_id: api-calls
                      credit_cost: 1
                    - metered_feature_id: image-generations
                      credit_cost: 10
            example:
              feature_id: api-calls
              name: API Calls
              type: metered
              consumable: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: >-
                      The unique identifier for this feature, used in /check and
                      /track calls.
                  name:
                    type: string
                    description: >-
                      Human-readable name displayed in the dashboard and billing
                      UI.
                  type:
                    enum:
                      - boolean
                      - metered
                      - credit_system
                      - ai_credit_system
                    type: string
                    description: >-
                      Feature type: 'boolean' for on/off access, 'metered' for
                      usage-tracked features, 'credit_system' for unified credit
                      pools, 'ai_credit_system' for model-based token pricing.
                  consumable:
                    type: boolean
                    description: >-
                      For metered features: true if usage resets periodically
                      (API calls, credits), false if allocated persistently
                      (seats, storage).
                  event_names:
                    type: array
                    items:
                      type: string
                    description: >-
                      Event names that trigger this feature's balance. Allows
                      multiple features to respond to a single event.
                  credit_schema:
                    type: array
                    items:
                      anyOf:
                        - type: object
                          properties:
                            metered_feature_id:
                              type: string
                              minLength: 1
                              description: >-
                                ID of the metered feature that draws from this
                                credit system.
                            billing_units:
                              type: number
                              exclusiveMinimum: 0
                              description: >-
                                Number of metered-feature units priced together.
                                Defaults to one when omitted.
                            dimensions:
                              type: object
                              propertyNames:
                                type: string
                                minLength: 1
                                maxLength: 64
                              additionalProperties:
                                anyOf:
                                  - type: object
                                    properties:
                                      match:
                                        type: object
                                        propertyNames:
                                          type: string
                                        additionalProperties:
                                          type: string
                                        description: >-
                                          Event properties this entry applies to.
                                          Every key must equal the tracked
                                          property, compared as strings.
                                      priority:
                                        type: integer
                                        minimum: -9007199254740991
                                        maximum: 9007199254740991
                                        description: >-
                                          Breaks ties between dimensions that
                                          match the same number of keys. Higher
                                          wins.
                                      tier_behavior:
                                        const: graduated
                                      tiers:
                                        type: array
                                        minItems: 1
                                        items:
                                          type: object
                                          properties:
                                            to:
                                              anyOf:
                                                - type: number
                                                  exclusiveMinimum: 0
                                                - enum:
                                                    - inf
                                                  type: string
                                              description: >-
                                                Inclusive upper usage boundary for this
                                                graduated tier. The final tier must be
                                                'inf'.
                                            credit_cost:
                                              type: number
                                              minimum: 0
                                              description: >-
                                                Credits consumed per billing-unit group
                                                within this tier.
                                          required:
                                            - to
                                            - credit_cost
                                    required:
                                      - match
                                      - tier_behavior
                                      - tiers
                                    additionalProperties: false
                                  - type: object
                                    properties:
                                      match:
                                        type: object
                                        propertyNames:
                                          type: string
                                        additionalProperties:
                                          type: string
                                        description: >-
                                          Event properties this entry applies to.
                                          Every key must equal the tracked
                                          property, compared as strings.
                                      priority:
                                        type: integer
                                        minimum: -9007199254740991
                                        maximum: 9007199254740991
                                        description: >-
                                          Breaks ties between dimensions that
                                          match the same number of keys. Higher
                                          wins.
                                      credit_cost:
                                        type: number
                                        minimum: 0
                                        description: >-
                                          Credits consumed per billing-unit group
                                          when this dimension matches.
                                    required:
                                      - match
                                      - credit_cost
                                    additionalProperties: false
                              description: >-
                                Named rates chosen by event properties. The most
                                specific match sets the rate; with no match the
                                item's own rate applies.
                            multipliers:
                              type: object
                              propertyNames:
                                type: string
                                minLength: 1
                                maxLength: 64
                              additionalProperties:
                                type: object
                                properties:
                                  match:
                                    type: object
                                    propertyNames:
                                      type: string
                                    additionalProperties:
                                      type: string
                                    description: >-
                                      Event properties this entry applies to.
                                      Every key must equal the tracked property,
                                      compared as strings.
                                  factor:
                                    type: number
                                    exclusiveMinimum: 0
                                    description: >-
                                      Multiplies the matched rate. All matching
                                      multipliers stack.
                                  add:
                                    type: number
                                    description: >-
                                      Added to the rate after every factor is
                                      applied, in credits per billing-unit
                                      group.
                                required:
                                  - match
                                additionalProperties: false
                              description: >-
                                Named adjustments chosen by event properties.
                                Every match applies: factors multiply, then adds
                                are summed.
                            tier_behavior:
                              const: graduated
                            tiers:
                              type: array
                              minItems: 1
                              items:
                                type: object
                                properties:
                                  to:
                                    anyOf:
                                      - type: number
                                        exclusiveMinimum: 0
                                      - enum:
                                          - inf
                                        type: string
                                    description: >-
                                      Inclusive upper usage boundary for this
                                      graduated tier. The final tier must be
                                      'inf'.
                                  credit_cost:
                                    type: number
                                    minimum: 0
                                    description: >-
                                      Credits consumed per billing-unit group
                                      within this tier.
                                required:
                                  - to
                                  - credit_cost
                          required:
                            - metered_feature_id
                            - tier_behavior
                            - tiers
                          additionalProperties: false
                        - type: object
                          properties:
                            metered_feature_id:
                              type: string
                              minLength: 1
                              description: >-
                                ID of the metered feature that draws from this
                                credit system.
                            billing_units:
                              type: number
                              exclusiveMinimum: 0
                              description: >-
                                Number of metered-feature units priced together.
                                Defaults to one when omitted.
                            dimensions:
                              type: object
                              propertyNames:
                                type: string
                                minLength: 1
                                maxLength: 64
                              additionalProperties:
                                anyOf:
                                  - type: object
                                    properties:
                                      match:
                                        type: object
                                        propertyNames:
                                          type: string
                                        additionalProperties:
                                          type: string
                                        description: >-
                                          Event properties this entry applies to.
                                          Every key must equal the tracked
                                          property, compared as strings.
                                      priority:
                                        type: integer
                                        minimum: -9007199254740991
                                        maximum: 9007199254740991
                                        description: >-
                                          Breaks ties between dimensions that
                                          match the same number of keys. Higher
                                          wins.
                                      tier_behavior:
                                        const: graduated
                                      tiers:
                                        type: array
                                        minItems: 1
                                        items:
                                          type: object
                                          properties:
                                            to:
                                              anyOf:
                                                - type: number
                                                  exclusiveMinimum: 0
                                                - enum:
                                                    - inf
                                                  type: string
                                              description: >-
                                                Inclusive upper usage boundary for this
                                                graduated tier. The final tier must be
                                                'inf'.
                                            credit_cost:
                                              type: number
                                              minimum: 0
                                              description: >-
                                                Credits consumed per billing-unit group
                                                within this tier.
                                          required:
                                            - to
                                            - credit_cost
                                    required:
                                      - match
                                      - tier_behavior
                                      - tiers
                                    additionalProperties: false
                                  - type: object
                                    properties:
                                      match:
                                        type: object
                                        propertyNames:
                                          type: string
                                        additionalProperties:
                                          type: string
                                        description: >-
                                          Event properties this entry applies to.
                                          Every key must equal the tracked
                                          property, compared as strings.
                                      priority:
                                        type: integer
                                        minimum: -9007199254740991
                                        maximum: 9007199254740991
                                        description: >-
                                          Breaks ties between dimensions that
                                          match the same number of keys. Higher
                                          wins.
                                      credit_cost:
                                        type: number
                                        minimum: 0
                                        description: >-
                                          Credits consumed per billing-unit group
                                          when this dimension matches.
                                    required:
                                      - match
                                      - credit_cost
                                    additionalProperties: false
                              description: >-
                                Named rates chosen by event properties. The most
                                specific match sets the rate; with no match the
                                item's own rate applies.
                            multipliers:
                              type: object
                              propertyNames:
                                type: string
                                minLength: 1
                                maxLength: 64
                              additionalProperties:
                                type: object
                                properties:
                                  match:
                                    type: object
                                    propertyNames:
                                      type: string
                                    additionalProperties:
                                      type: string
                                    description: >-
                                      Event properties this entry applies to.
                                      Every key must equal the tracked property,
                                      compared as strings.
                                  factor:
                                    type: number
                                    exclusiveMinimum: 0
                                    description: >-
                                      Multiplies the matched rate. All matching
                                      multipliers stack.
                                  add:
                                    type: number
                                    description: >-
                                      Added to the rate after every factor is
                                      applied, in credits per billing-unit
                                      group.
                                required:
                                  - match
                                additionalProperties: false
                              description: >-
                                Named adjustments chosen by event properties.
                                Every match applies: factors multiply, then adds
                                are summed.
                            credit_cost:
                              type: number
                              minimum: 0
                              description: Credits consumed per billing-unit group.
                          required:
                            - metered_feature_id
                            - credit_cost
                          additionalProperties: false
                        - type: object
                          properties:
                            metered_feature_id:
                              const: ''
                            billing_units:
                              type: number
                              exclusiveMinimum: 0
                              description: >-
                                Number of metered-feature units priced together.
                                Defaults to one when omitted.
                            dimensions:
                              type: object
                              propertyNames:
                                type: string
                                minLength: 1
                                maxLength: 64
                              additionalProperties:
                                anyOf:
                                  - type: object
                                    properties:
                                      match:
                                        type: object
                                        propertyNames:
                                          type: string
                                        additionalProperties:
                                          type: string
                                        description: >-
                                          Event properties this entry applies to.
                                          Every key must equal the tracked
                                          property, compared as strings.
                                      priority:
                                        type: integer
                                        minimum: -9007199254740991
                                        maximum: 9007199254740991
                                        description: >-
                                          Breaks ties between dimensions that
                                          match the same number of keys. Higher
                                          wins.
                                      tier_behavior:
                                        const: graduated
                                      tiers:
                                        type: array
                                        minItems: 1
                                        items:
                                          type: object
                                          properties:
                                            to:
                                              anyOf:
                                                - type: number
                                                  exclusiveMinimum: 0
                                                - enum:
                                                    - inf
                                                  type: string
                                              description: >-
                                                Inclusive upper usage boundary for this
                                                graduated tier. The final tier must be
                                                'inf'.
                                            credit_cost:
                                              type: number
                                              minimum: 0
                                              description: >-
                                                Credits consumed per billing-unit group
                                                within this tier.
                                          required:
                                            - to
                                            - credit_cost
                                    required:
                                      - match
                                      - tier_behavior
                                      - tiers
                                    additionalProperties: false
                                  - type: object
                                    properties:
                                      match:
                                        type: object
                                        propertyNames:
                                          type: string
                                        additionalProperties:
                                          type: string
                                        description: >-
                                          Event properties this entry applies to.
                                          Every key must equal the tracked
                                          property, compared as strings.
                                      priority:
                                        type: integer
                                        minimum: -9007199254740991
                                        maximum: 9007199254740991
                                        description: >-
                                          Breaks ties between dimensions that
                                          match the same number of keys. Higher
                                          wins.
                                      credit_cost:
                                        type: number
                                        minimum: 0
                                        description: >-
                                          Credits consumed per billing-unit group
                                          when this dimension matches.
                                    required:
                                      - match
                                      - credit_cost
                                    additionalProperties: false
                              description: >-
                                Named rates chosen by event properties. The most
                                specific match sets the rate; with no match the
                                item's own rate applies.
                            multipliers:
                              type: object
                              propertyNames:
                                type: string
                                minLength: 1
                                maxLength: 64
                              additionalProperties:
                                type: object
                                properties:
                                  match:
                                    type: object
                                    propertyNames:
                                      type: string
                                    additionalProperties:
                                      type: string
                                    description: >-
                                      Event properties this entry applies to.
                                      Every key must equal the tracked property,
                                      compared as strings.
                                  factor:
                                    type: number
                                    exclusiveMinimum: 0
                                    description: >-
                                      Multiplies the matched rate. All matching
                                      multipliers stack.
                                  add:
                                    type: number
                                    description: >-
                                      Added to the rate after every factor is
                                      applied, in credits per billing-unit
                                      group.
                                required:
                                  - match
                                additionalProperties: false
                              description: >-
                                Named adjustments chosen by event properties.
                                Every match applies: factors multiply, then adds
                                are summed.
                            credit_cost:
                              type: number
                              minimum: 0
                              description: Credits consumed per billing-unit group.
                          required:
                            - metered_feature_id
                            - credit_cost
                          additionalProperties: false
                    description: >-
                      For classic credit systems: maps metered features to flat
                      or graduated credit costs.
                  invoice_credit:
                    type: boolean
                    description: >-
                      Whether usage of this classic credit system should be
                      itemized as invoice credits.
                  model_markups:
                    anyOf:
                      - type: object
                        propertyNames:
                          type: string
                          pattern: .+\/.+
                        additionalProperties:
                          type: object
                          properties:
                            markup:
                              type: number
                              minimum: -100
                            input_cost:
                              type: number
                              minimum: 0
                            output_cost:
                              type: number
                              minimum: 0
                      - type: 'null'
                    description: Per-model markup overrides for AI credit systems.
                  default_markup:
                    type: number
                    minimum: -100
                    description: >-
                      Default percentage markup for AI credit systems. Use -100
                      to make usage free.
                  provider_markups:
                    anyOf:
                      - type: object
                        propertyNames:
                          type: string
                        additionalProperties:
                          type: object
                          properties:
                            markup:
                              type: number
                              minimum: -100
                          required:
                            - markup
                      - type: 'null'
                    description: >-
                      Per-provider default markup percentages for AI credit
                      systems.
                  display:
                    type: object
                    properties:
                      singular:
                        anyOf:
                          - type: string
                          - type: 'null'
                        description: >-
                          Singular form for UI display (e.g., 'API call',
                          'seat').
                      plural:
                        anyOf:
                          - type: string
                          - type: 'null'
                        description: >-
                          Plural form for UI display (e.g., 'API calls',
                          'seats').
                    description: >-
                      Display names for the feature in billing UI and
                      customer-facing components.
                  archived:
                    type: boolean
                    description: >-
                      Whether the feature is archived and hidden from the
                      dashboard.
                  processors:
                    type: object
                    properties:
                      stripe:
                        type: object
                        properties:
                          product_id:
                            type: string
                            description: >-
                              Stripe product ID this feature's usage prices bill
                              under.
                          meter_id:
                            type: string
                            description: >-
                              Stripe meter ID used to create this feature's
                              metered price.
                    description: >-
                      Processor mappings for this feature. Present when a Stripe
                      product or meter is set.
                required:
                  - id
                  - name
                  - type
                  - consumable
                  - archived
                examples:
                  - id: api-calls
                    name: API Calls
                    type: metered
                    consumable: true
                    archived: false
                    display:
                      singular: API call
                      plural: API calls
              example:
                id: api-calls
                name: API Calls
                type: metered
                consumable: true
                archived: false
                display:
                  singular: API call
                  plural: API calls
      x-codeSamples:
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Autumn } from 'autumn-js'

            const autumn = new Autumn()

            const result = await autumn.features.create({
              name: "API Calls",
              type: "metered",
              consumable: true,
              featureId: "api-calls",
            });
        - lang: python
          label: Python (SDK)
          source: |-
            from autumn_sdk import Autumn

            autumn = Autumn(secret_key="am_sk_test...")

            res = autumn.features.create(
                name="API Calls",
                type_="metered",
                feature_id="api-calls",
                consumable=True,
            )
components:
  securitySchemes:
    secretKey:
      type: http
      scheme: bearer
      bearerFormat: JWT

````