Custom Properties

Define custom metadata schemas to attach structured data to your request logs.

About

Custom Properties let you define a schema of typed metadata fields that are attached to every request log in the Prism gateway. Once defined, you can tag requests with values for these properties and then filter, search, and group your logs by them.


When to use

  • Segmentation: Tag requests with user_tier, feature_name, or environment so you can filter logs by segment
  • Cost attribution: Attach a team or cost_center property to every request for per-team cost breakdowns
  • Debugging: Mark requests with a session_id or trace_id to correlate gateway logs with your own tracing system

Managing custom properties

Viewing properties

Go to Gateway > Custom Properties. The table shows all defined properties with their name, type, whether they are required, any allowed values (for Enum types), and their default value.

Creating a property

  1. Click + Create Property
  2. Fill in the form:
FieldRequiredDescription
Property NameYesThe key used in request metadata (e.g., user_tier)
DescriptionOptionalHuman-readable label shown in the UI
TypeYesString, Number, Boolean, or Enum
RequiredOptionalToggle on to enforce the property on every request
Default ValueOptionalValue used when the property is not provided

For Enum type, you also define the list of allowed values. Requests with values outside this list will be rejected if the property is required.

  1. Click Save

Sending property values on requests

Pass custom property values as metadata on your request. Pass custom property values in the x-prism-metadata header (OpenAI SDK / cURL) .

import json
from openai import OpenAI

client = OpenAI(
    base_url="https://gateway.futureagi.com/v1",
    api_key="sk-prism-your-key",
)

response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Summarize this document."}],
    extra_headers={
        "x-prism-metadata": json.dumps({
            "user_tier": "enterprise",
            "team": "data-science",
            "environment": "production",
        }),
    },
)
curl https://gateway.futureagi.com/v1/chat/completions \
  -H "Authorization: Bearer sk-prism-your-key" \
  -H "Content-Type: application/json" \
  -H 'x-prism-metadata: {"user_tier":"enterprise","team":"data-science","environment":"production"}' \
  -d '{
    "model": "gpt-4o",
    "messages": [{"role": "user", "content": "Summarize this document."}]
  }'

The values appear in the request log and are available for filtering in the Observability view.


Log preview

The Log Preview panel on the Custom Properties page shows how property values appear in the raw request log JSON, so you can verify the schema before deploying.


Next Steps

Was this page helpful?

Questions & Discussion