Skip to Content

Get prompt summary

POSThttps://api.respan.ai/api/prompts/summary/

Returns the number of prompts matching the filters.

Servers

https://api.respan.ai: Respan API Server

Authentication

RespanApiKey

Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer <RESPAN_API_KEY>. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -> Providers or respan_params.credential_override in the request body, not in this authentication field.

HTTP scheme: bearer; format: Respan API key.

HTTP
Authorization: Bearer $RESPAN_API_KEY

Or:

DashboardJwt

Use a dashboard JWT only for dashboard-authenticated endpoints. Respan API-key endpoints use the respanApiKey auth field instead.

HTTP scheme: bearer; format: Dashboard JWT.

HTTP
Authorization: Bearer $RESPAN_DASHBOARD_JWT

Request body

The request body is optional.

application/json

Field Type Requirement Description and constraints
$ object Optional body
-
filters object Optional
Each key is a field to filter on, and each value is a condition: {"<field>": {"operator": "<operator>", "value": [...]}}. A prompt must match every condition. To set two conditions on one field, such as a range, pass a list of conditions.

Operators: "" (equals, the default), not, in, not_in, lt, lte, gt, gte, contains, not_contains, icontains (ignores case), startswith, not_startswith, endswith, not_endswith, empty, not_empty. Put values in a list: "" and in match any of the listed values, and not and not_in match none of them. Other operators take one value; for empty and not_empty, send [""].

Fields: prompt_id, prompt_slug, name, description, starred, commit_count, version fields through current_version__<field> or live_version__<field> (for example current_version__model or current_version__updated_at), and is_deleted (send "value": true to count deleted prompts instead of active ones). Unsupported fields return a 400 error.

Example:

json<br />{<br /> "starred": {"operator": "", "value": [true]},<br /> "current_version__model": {"operator": "", "value": ["gpt-5.5"]}<br />}<br />
filters.prompt_id object Optional
A filter condition with an operator and value.
Reference: #/components/schemas/FilterValue
filters.prompt_id.operator string Optional
Comparison operator. An empty string means equals.
Allowed: "", "not", "in", "not_in", "lt", "lte", "gt", "gte", "contains", "not_contains", "icontains", "startswith", "not_startswith", "endswith", "not_endswith", "empty", "not_empty"
Default: “
Example: "gte"
filters.prompt_id.value array<any> Required in parent
Value(s) to filter by.
Example: [0.01]
filters.prompt_id.value[] any Array item
-
filters.prompt_slug object Optional
A filter condition with an operator and value.
Reference: #/components/schemas/FilterValue
filters.prompt_slug.operator string Optional
Comparison operator. An empty string means equals.
Allowed: "", "not", "in", "not_in", "lt", "lte", "gt", "gte", "contains", "not_contains", "icontains", "startswith", "not_startswith", "endswith", "not_endswith", "empty", "not_empty"
Default: “
Example: "gte"
filters.prompt_slug.value array<any> Required in parent
Value(s) to filter by.
Example: [0.01]
filters.prompt_slug.value[] any Array item
-
filters.name object Optional
A filter condition with an operator and value.
Reference: #/components/schemas/FilterValue
filters.name.operator string Optional
Comparison operator. An empty string means equals.
Allowed: "", "not", "in", "not_in", "lt", "lte", "gt", "gte", "contains", "not_contains", "icontains", "startswith", "not_startswith", "endswith", "not_endswith", "empty", "not_empty"
Default: “
Example: "gte"
filters.name.value array<any> Required in parent
Value(s) to filter by.
Example: [0.01]
filters.name.value[] any Array item
-
filters.description object Optional
A filter condition with an operator and value.
Reference: #/components/schemas/FilterValue
filters.description.operator string Optional
Comparison operator. An empty string means equals.
Allowed: "", "not", "in", "not_in", "lt", "lte", "gt", "gte", "contains", "not_contains", "icontains", "startswith", "not_startswith", "endswith", "not_endswith", "empty", "not_empty"
Default: “
Example: "gte"
filters.description.value array<any> Required in parent
Value(s) to filter by.
Example: [0.01]
filters.description.value[] any Array item
-
filters.starred object Optional
A filter condition with an operator and value.
Reference: #/components/schemas/FilterValue
filters.starred.operator string Optional
Comparison operator. An empty string means equals.
Allowed: "", "not", "in", "not_in", "lt", "lte", "gt", "gte", "contains", "not_contains", "icontains", "startswith", "not_startswith", "endswith", "not_endswith", "empty", "not_empty"
Default: “
Example: "gte"
filters.starred.value array<any> Required in parent
Value(s) to filter by.
Example: [0.01]
filters.starred.value[] any Array item
-
filters.tags object Optional
A filter condition with an operator and value.
Reference: #/components/schemas/FilterValue
filters.tags.operator string Optional
Comparison operator. An empty string means equals.
Allowed: "", "not", "in", "not_in", "lt", "lte", "gt", "gte", "contains", "not_contains", "icontains", "startswith", "not_startswith", "endswith", "not_endswith", "empty", "not_empty"
Default: “
Example: "gte"
filters.tags.value array<any> Required in parent
Value(s) to filter by.
Example: [0.01]
filters.tags.value[] any Array item
-
filters.current_version__updated_at object Optional
A filter condition with an operator and value.
Reference: #/components/schemas/FilterValue
filters.current_version__updated_at.operator string Optional
Comparison operator. An empty string means equals.
Allowed: "", "not", "in", "not_in", "lt", "lte", "gt", "gte", "contains", "not_contains", "icontains", "startswith", "not_startswith", "endswith", "not_endswith", "empty", "not_empty"
Default: “
Example: "gte"
filters.current_version__updated_at.value array<any> Required in parent
Value(s) to filter by.
Example: [0.01]
filters.current_version__updated_at.value[] any Array item
-
filters.current_version__created_at object Optional
A filter condition with an operator and value.
Reference: #/components/schemas/FilterValue
filters.current_version__created_at.operator string Optional
Comparison operator. An empty string means equals.
Allowed: "", "not", "in", "not_in", "lt", "lte", "gt", "gte", "contains", "not_contains", "icontains", "startswith", "not_startswith", "endswith", "not_endswith", "empty", "not_empty"
Default: “
Example: "gte"
filters.current_version__created_at.value array<any> Required in parent
Value(s) to filter by.
Example: [0.01]
filters.current_version__created_at.value[] any Array item
-
filters.is_deleted object Optional
A filter condition with an operator and value.
Reference: #/components/schemas/FilterValue
filters.is_deleted.operator string Optional
Comparison operator. An empty string means equals.
Allowed: "", "not", "in", "not_in", "lt", "lte", "gt", "gte", "contains", "not_contains", "icontains", "startswith", "not_startswith", "endswith", "not_endswith", "empty", "not_empty"
Default: “
Example: "gte"
filters.is_deleted.value array<any> Required in parent
Value(s) to filter by.
Example: [0.01]
filters.is_deleted.value[] any Array item
-

OpenAPI request schema

{
  "type": "object",
  "properties": {
    "filters": {
      "type": "object",
      "description": "Each key is a field to filter on, and each value is a condition: `{\"<field>\": {\"operator\": \"<operator>\", \"value\": [...]}}`. A prompt must match every condition. To set two conditions on one field, such as a range, pass a list of conditions.\n\n**Operators:** `\"\"` (equals, the default), `not`, `in`, `not_in`, `lt`, `lte`, `gt`, `gte`, `contains`, `not_contains`, `icontains` (ignores case), `startswith`, `not_startswith`, `endswith`, `not_endswith`, `empty`, `not_empty`. Put values in a list: `\"\"` and `in` match any of the listed values, and `not` and `not_in` match none of them. Other operators take one value; for `empty` and `not_empty`, send `[\"\"]`.\n\n**Fields:** `prompt_id`, `prompt_slug`, `name`, `description`, `starred`, `commit_count`, version fields through `current_version__<field>` or `live_version__<field>` (for example `current_version__model` or `current_version__updated_at`), and `is_deleted` (send `\"value\": true` to count deleted prompts instead of active ones). Unsupported fields return a 400 error.\n\n**Example:**\n\n```json\n{\n  \"starred\": {\"operator\": \"\", \"value\": [true]},\n  \"current_version__model\": {\"operator\": \"\", \"value\": [\"gpt-5.5\"]}\n}\n```",
      "properties": {
        "prompt_id": {
          "$ref": "#/components/schemas/FilterValue"
        },
        "prompt_slug": {
          "$ref": "#/components/schemas/FilterValue"
        },
        "name": {
          "$ref": "#/components/schemas/FilterValue"
        },
        "description": {
          "$ref": "#/components/schemas/FilterValue"
        },
        "starred": {
          "$ref": "#/components/schemas/FilterValue"
        },
        "tags": {
          "$ref": "#/components/schemas/FilterValue"
        },
        "current_version__updated_at": {
          "$ref": "#/components/schemas/FilterValue"
        },
        "current_version__created_at": {
          "$ref": "#/components/schemas/FilterValue"
        },
        "is_deleted": {
          "$ref": "#/components/schemas/FilterValue"
        }
      }
    }
  }
}
Example
JSON
{ "filters": { "name": { "operator": "icontains", "value": [ "support" ] } } }

Responses

200

Filtered prompt summary statistics.

application/json

Field Type Requirement Description and constraints
$ object Body
Example: {"total_count":42}
total_count integer Optional
Total number of prompts matching the filters.

OpenAPI response schema

{
  "type": "object",
  "properties": {
    "total_count": {
      "type": "integer",
      "description": "Total number of prompts matching the filters."
    }
  },
  "example": {
    "total_count": 42
  }
}

403

The API key is missing, invalid or expired.

application/json

Field Type Requirement Description and constraints
$ object Body
-
detail string Required in parent
-

OpenAPI response schema

{
  "type": "object",
  "required": [
    "detail"
  ],
  "properties": {
    "detail": {
      "type": "string"
    }
  }
}
Example
JSON
{ "detail": "Your API key is invalid or expired, please check your API key in the platform settings." }

OpenAPI source

The operation and referenced components below retain the complete OpenAPI definitions, including constraints and examples.

OpenAPI operation

{
  "summary": "Get prompt summary",
  "operationId": "getPromptsSummaryWithFilters",
  "tags": [
    "Prompts"
  ],
  "description": "Returns the number of prompts matching the filters.",
  "requestBody": {
    "required": false,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "filters": {
              "type": "object",
              "description": "Each key is a field to filter on, and each value is a condition: `{\"<field>\": {\"operator\": \"<operator>\", \"value\": [...]}}`. A prompt must match every condition. To set two conditions on one field, such as a range, pass a list of conditions.\n\n**Operators:** `\"\"` (equals, the default), `not`, `in`, `not_in`, `lt`, `lte`, `gt`, `gte`, `contains`, `not_contains`, `icontains` (ignores case), `startswith`, `not_startswith`, `endswith`, `not_endswith`, `empty`, `not_empty`. Put values in a list: `\"\"` and `in` match any of the listed values, and `not` and `not_in` match none of them. Other operators take one value; for `empty` and `not_empty`, send `[\"\"]`.\n\n**Fields:** `prompt_id`, `prompt_slug`, `name`, `description`, `starred`, `commit_count`, version fields through `current_version__<field>` or `live_version__<field>` (for example `current_version__model` or `current_version__updated_at`), and `is_deleted` (send `\"value\": true` to count deleted prompts instead of active ones). Unsupported fields return a 400 error.\n\n**Example:**\n\n```json\n{\n  \"starred\": {\"operator\": \"\", \"value\": [true]},\n  \"current_version__model\": {\"operator\": \"\", \"value\": [\"gpt-5.5\"]}\n}\n```",
              "properties": {
                "prompt_id": {
                  "$ref": "#/components/schemas/FilterValue"
                },
                "prompt_slug": {
                  "$ref": "#/components/schemas/FilterValue"
                },
                "name": {
                  "$ref": "#/components/schemas/FilterValue"
                },
                "description": {
                  "$ref": "#/components/schemas/FilterValue"
                },
                "starred": {
                  "$ref": "#/components/schemas/FilterValue"
                },
                "tags": {
                  "$ref": "#/components/schemas/FilterValue"
                },
                "current_version__updated_at": {
                  "$ref": "#/components/schemas/FilterValue"
                },
                "current_version__created_at": {
                  "$ref": "#/components/schemas/FilterValue"
                },
                "is_deleted": {
                  "$ref": "#/components/schemas/FilterValue"
                }
              }
            }
          }
        },
        "example": {
          "filters": {
            "name": {
              "operator": "icontains",
              "value": [
                "support"
              ]
            }
          }
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Filtered prompt summary statistics.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "total_count": {
                "type": "integer",
                "description": "Total number of prompts matching the filters."
              }
            },
            "example": {
              "total_count": 42
            }
          }
        }
      }
    },
    "403": {
      "$ref": "#/components/responses/InvalidApiKey"
    }
  },
  "security": [
    {
      "RespanApiKey": []
    },
    {
      "DashboardJwt": []
    }
  ]
}

OpenAPI path metadata

{}

Referenced OpenAPI components

{
  "responses": {
    "InvalidApiKey": {
      "description": "The API key is missing, invalid or expired.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "detail"
            ],
            "properties": {
              "detail": {
                "type": "string"
              }
            }
          },
          "example": {
            "detail": "Your API key is invalid or expired, please check your API key in the platform settings."
          }
        }
      }
    }
  },
  "schemas": {
    "FilterValue": {
      "type": "object",
      "description": "A filter condition with an operator and value.",
      "required": [
        "value"
      ],
      "properties": {
        "operator": {
          "type": "string",
          "description": "Comparison operator. An empty string means equals.",
          "enum": [
            "",
            "not",
            "in",
            "not_in",
            "lt",
            "lte",
            "gt",
            "gte",
            "contains",
            "not_contains",
            "icontains",
            "startswith",
            "not_startswith",
            "endswith",
            "not_endswith",
            "empty",
            "not_empty"
          ],
          "default": "",
          "example": "gte"
        },
        "value": {
          "type": "array",
          "description": "Value(s) to filter by.",
          "items": {},
          "example": [
            0.01
          ]
        }
      }
    }
  },
  "securitySchemes": {
    "DashboardJwt": {
      "type": "http",
      "scheme": "bearer",
      "bearerFormat": "Dashboard JWT",
      "description": "Use a dashboard JWT only for dashboard-authenticated endpoints. Respan API-key endpoints use the respanApiKey auth field instead.",
      "x-fern-bearer": {
        "name": "dashboardJwt",
        "env": "RESPAN_DASHBOARD_JWT"
      }
    },
    "RespanApiKey": {
      "type": "http",
      "scheme": "bearer",
      "bearerFormat": "Respan API key",
      "description": "Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer <RESPAN_API_KEY>. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -> Providers or respan_params.credential_override in the request body, not in this authentication field.",
      "x-fern-bearer": {
        "name": "respanApiKey",
        "env": "RESPAN_API_KEY"
      }
    }
  }
}