{
  "openapi": "3.1.0",
  "info": {
    "title": "GTM Brigade API",
    "version": "1.0.0",
    "description": "Run the GTM Brigade workflow from your own systems: maintain the watchlist, pull and filter posts, place reactions, generate and post comments, and work the creator ranking.\n\n**Authentication.** Every request uses an organization API key as a bearer token: `Authorization: Bearer gtm_...`. Keys are scoped to a single organization, so all data is org-isolated from the token. You never pass an org id.\n\n**Acting as a member.** The key is owned by the organization, but any write that touches LinkedIn (reactions, comments) or attributes an action posts as a specific person. Pass `member_id` (the id of an org member with a connected LinkedIn account) on every write. A `member_id` outside the key’s organization is rejected with `400`.\n\n**Idempotency.** Write endpoints accept an `Idempotency-Key` header so retries never double-post.\n\n**Credits.** Adding a profile spends an enrichment credit; generating a comment spends AI credits (per character, at generation, not at posting); reactions are free. A spending call on an empty pool returns `422 insufficient_credits`."
  },
  "servers": [
    {
      "url": "https://api.gtmbrigade.com",
      "description": "Production"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Watchlist",
      "description": "The monitored ICP profiles you scan."
    },
    {
      "name": "Feed & posts",
      "description": "Discovered posts from watchlist scans and keyword search."
    },
    {
      "name": "Keywords",
      "description": "The tracked keyword set behind the last-24h search feed."
    },
    {
      "name": "Reactions",
      "description": "Place a reaction directly on a LinkedIn post."
    },
    {
      "name": "Comments",
      "description": "Generate a KB-anchored draft, then post it: two steps."
    },
    {
      "name": "Ranking",
      "description": "The creator leaderboard, scored across LinkedIn by industry."
    },
    {
      "name": "Credits",
      "description": "Read balances before a job so you can throttle."
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "gtm_...",
        "description": "Organization API key. Server-side only: never ship it in client code."
      }
    },
    "parameters": {
      "cursor": {
        "name": "cursor",
        "in": "query",
        "schema": {
          "type": "string"
        },
        "description": "Pagination cursor from a previous response."
      },
      "limit": {
        "name": "limit",
        "in": "query",
        "schema": {
          "type": "integer"
        },
        "description": "Page size."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "example": "invalid_member"
              },
              "message": {
                "type": "string"
              },
              "details": {}
            }
          }
        }
      },
      "Profile": {
        "type": "object",
        "properties": {
          "profile_id": {
            "type": "string",
            "example": "ld_9f2a"
          },
          "name": {
            "type": "string",
            "nullable": true,
            "example": "Jane Doe"
          },
          "headline": {
            "type": "string",
            "nullable": true,
            "example": "VP Product · Acme"
          },
          "linkedin_url": {
            "type": "string",
            "nullable": true,
            "example": "https://linkedin.com/in/janedoe"
          },
          "industry": {
            "type": "string",
            "nullable": true,
            "example": "Computer Software"
          },
          "country": {
            "type": "string",
            "nullable": true,
            "example": "US"
          },
          "followers": {
            "type": "integer",
            "nullable": true,
            "example": 18400
          },
          "enriched": {
            "type": "boolean",
            "example": true
          },
          "added_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        }
      },
      "Post": {
        "type": "object",
        "properties": {
          "post_id": {
            "type": "string",
            "example": "pst_a81"
          },
          "linkedin_url": {
            "type": "string",
            "example": "https://linkedin.com/feed/update/urn:li:activity:73..."
          },
          "author": {
            "type": "object",
            "properties": {
              "profile_id": {
                "type": "string",
                "nullable": true
              },
              "name": {
                "type": "string",
                "nullable": true
              },
              "headline": {
                "type": "string",
                "nullable": true
              },
              "linkedin_url": {
                "type": "string",
                "nullable": true
              }
            }
          },
          "text": {
            "type": "string",
            "nullable": true
          },
          "ai_summary": {
            "type": "string",
            "nullable": true
          },
          "posted_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "source": {
            "type": "string",
            "example": "keyword"
          },
          "keywords_matched": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "in_watchlist": {
            "type": "boolean"
          },
          "seen": {
            "type": "boolean"
          },
          "engagement": {
            "type": "object",
            "properties": {
              "likes": {
                "type": "integer"
              },
              "comments": {
                "type": "integer"
              }
            }
          }
        }
      },
      "Creator": {
        "type": "object",
        "properties": {
          "creator_id": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "linkedin_url": {
            "type": "string",
            "nullable": true
          },
          "country": {
            "type": "string",
            "nullable": true
          },
          "industry": {
            "type": "string",
            "nullable": true
          },
          "score": {
            "type": "number",
            "nullable": true
          },
          "followers": {
            "type": "integer",
            "nullable": true
          },
          "posts_60d": {
            "type": "integer",
            "nullable": true
          },
          "engagement_rate": {
            "type": "number",
            "nullable": true
          },
          "trend_60d": {
            "type": "number",
            "nullable": true
          },
          "rank": {
            "type": "integer",
            "nullable": true
          }
        }
      },
      "CreditPool": {
        "type": "object",
        "properties": {
          "used": {
            "type": "integer"
          },
          "limit": {
            "type": "integer"
          },
          "resets_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        }
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "Missing or invalid API key.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Forbidden": {
        "description": "The key lacks the required scope.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "InvalidMember": {
        "description": "`member_id` missing, foreign to the org, or no connected LinkedIn.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "InsufficientCredits": {
        "description": "The named credit pool is exhausted.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    }
  },
  "paths": {
    "/v1/watchlist": {
      "get": {
        "tags": [
          "Watchlist"
        ],
        "summary": "List watchlist profiles",
        "description": "Cursor-paginated list of monitored profiles. Requires scope `read:watchlist`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/cursor"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Match against name / headline."
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of profiles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Profile"
                      }
                    },
                    "next_cursor": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      },
      "post": {
        "tags": [
          "Watchlist"
        ],
        "summary": "Add a profile",
        "description": "Add a profile by LinkedIn URL. Enrichment runs asynchronously and spends one enrichment credit. Requires scope `write:watchlist`.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "description": "Retries with the same key never double-add."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "linkedin_url",
                  "member_id"
                ],
                "properties": {
                  "linkedin_url": {
                    "type": "string",
                    "example": "https://linkedin.com/in/janedoe"
                  },
                  "member_id": {
                    "type": "string",
                    "description": "Org member the action is attributed to.",
                    "example": "usr_a1"
                  },
                  "list_id": {
                    "type": "string",
                    "description": "Optional list to place the profile in."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Profile added; enrichment queued.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "profile_id": {
                      "type": "string"
                    },
                    "enriched": {
                      "type": "boolean",
                      "example": false
                    },
                    "credits_spent": {
                      "type": "object",
                      "properties": {
                        "enrichment": {
                          "type": "integer",
                          "example": 1
                        }
                      }
                    },
                    "credits_remaining": {
                      "type": "object",
                      "properties": {
                        "enrichment": {
                          "type": "integer",
                          "example": 4821
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidMember"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/v1/watchlist/{profile_id}": {
      "get": {
        "tags": [
          "Watchlist"
        ],
        "summary": "Get a watchlist profile",
        "description": "The full enriched profile record. Requires scope `read:watchlist`.",
        "parameters": [
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The profile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Profile"
                }
              }
            }
          },
          "404": {
            "description": "Not found in your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Watchlist"
        ],
        "summary": "Remove a profile",
        "description": "Stop monitoring a profile. Requires scope `write:watchlist`.",
        "parameters": [
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "member_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Org member the action is attributed to."
          }
        ],
        "responses": {
          "200": {
            "description": "Removed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "removed": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidMember"
          }
        }
      }
    },
    "/v1/watchlist:bulk": {
      "post": {
        "tags": [
          "Watchlist"
        ],
        "summary": "Bulk add profiles",
        "description": "Add many profiles at once by LinkedIn URL. Requires scope `write:watchlist`.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "linkedin_urls",
                  "member_id"
                ],
                "properties": {
                  "linkedin_urls": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "member_id": {
                    "type": "string",
                    "example": "usr_a1"
                  },
                  "list_id": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Profiles added.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "added": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "skipped": {
                      "type": "array",
                      "items": {}
                    },
                    "credits_spent": {
                      "type": "object"
                    },
                    "credits_remaining": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/watchlist:from-ranking": {
      "post": {
        "tags": [
          "Watchlist"
        ],
        "summary": "Add creators from the ranking",
        "description": "Push top creators from the ranking into the watchlist, by id set or by filter. Requires scope `write:watchlist`.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "member_id"
                ],
                "properties": {
                  "member_id": {
                    "type": "string",
                    "example": "usr_a1"
                  },
                  "creator_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Explicit creators to add."
                  },
                  "filter": {
                    "type": "object",
                    "description": "Or a filter over the ranking.",
                    "properties": {
                      "industry": {
                        "type": "string"
                      },
                      "country": {
                        "type": "string"
                      },
                      "min_followers": {
                        "type": "integer"
                      },
                      "max_followers": {
                        "type": "integer"
                      },
                      "min_score": {
                        "type": "number"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Creators added.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "added": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "credits_spent": {
                      "type": "object"
                    },
                    "credits_remaining": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidMember"
          }
        }
      }
    },
    "/v1/feed/posts": {
      "get": {
        "tags": [
          "Feed & posts"
        ],
        "summary": "List feed posts",
        "description": "Filterable, cursor-paginated posts. Every item carries the canonical LinkedIn post URL. Requires scope `read:feed`.",
        "parameters": [
          {
            "name": "source",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "watchlist",
                "keyword",
                "all"
              ]
            }
          },
          {
            "name": "keyword",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "author_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "since",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "until",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "seen",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of posts.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Post"
                      }
                    },
                    "next_cursor": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/feed/posts/{post_id}": {
      "get": {
        "tags": [
          "Feed & posts"
        ],
        "summary": "Get a post",
        "description": "A single post with full text, AI summary, and its LinkedIn URL. Requires scope `read:feed`.",
        "parameters": [
          {
            "name": "post_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The post.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Post"
                }
              }
            }
          },
          "404": {
            "description": "Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/keywords": {
      "get": {
        "tags": [
          "Keywords"
        ],
        "summary": "List tracked keywords",
        "description": "The keywords currently tracked, with 24-hour post counts. Requires scope `read:keywords`.",
        "responses": {
          "200": {
            "description": "Tracked keywords.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "keyword": {
                        "type": "string"
                      },
                      "post_count_24h": {
                        "type": "integer",
                        "nullable": true
                      },
                      "tracked": {
                        "type": "boolean"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Keywords"
        ],
        "summary": "Replace tracked keywords",
        "description": "Replace the entire tracked keyword set (up to 5). Requires scope `write:keywords`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "keywords"
                ],
                "properties": {
                  "keywords": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "example": [
                      "product launch",
                      "series a"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The new tracked set.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tracked": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/feed/posts/{post_id}/reactions": {
      "post": {
        "tags": [
          "Reactions"
        ],
        "summary": "React to a post",
        "description": "Place a reaction on a post via a member’s LinkedIn. Reactions are free. Requires scope `write:reactions`.",
        "parameters": [
          {
            "name": "post_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "type",
                  "member_id"
                ],
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "LIKE",
                      "PRAISE",
                      "EMPATHY",
                      "INTEREST",
                      "APPRECIATION",
                      "ENTERTAINMENT"
                    ]
                  },
                  "member_id": {
                    "type": "string",
                    "description": "Org member whose LinkedIn places the reaction."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Reaction placed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "reaction_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "example": "posted"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidMember"
          }
        }
      }
    },
    "/v1/feed/posts/{post_id}/comments:generate": {
      "post": {
        "tags": [
          "Comments"
        ],
        "summary": "Generate a comment draft",
        "description": "Generate a KB-anchored draft in a chosen style. Returns the draft without posting. Spends AI credits at THIS call. Requires scope `write:comments`.",
        "parameters": [
          {
            "name": "post_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "style",
                  "member_id"
                ],
                "properties": {
                  "style": {
                    "type": "string",
                    "enum": [
                      "contrarian",
                      "pitch",
                      "approval"
                    ]
                  },
                  "member_id": {
                    "type": "string",
                    "description": "Org member the draft is generated for (KB + personal style)."
                  },
                  "max_chars": {
                    "type": "integer"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The draft.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "draft": {
                      "type": "string"
                    },
                    "style": {
                      "type": "string"
                    },
                    "kb_sources": {
                      "type": "array",
                      "items": {}
                    },
                    "credits_remaining": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/InsufficientCredits"
          }
        }
      }
    },
    "/v1/feed/posts/{post_id}/comments": {
      "post": {
        "tags": [
          "Comments"
        ],
        "summary": "Post a comment",
        "description": "Post final comment text to LinkedIn via a member. Idempotent. Requires scope `write:comments`.",
        "parameters": [
          {
            "name": "post_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "text",
                  "member_id"
                ],
                "properties": {
                  "text": {
                    "type": "string"
                  },
                  "member_id": {
                    "type": "string",
                    "description": "Org member whose LinkedIn posts the comment."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Comment posted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "comment_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "example": "posted"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "A comment already exists on this post.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/ranking/creators": {
      "get": {
        "tags": [
          "Ranking"
        ],
        "summary": "List ranked creators",
        "description": "Filter the leaderboard by industry, country, follower band, and score; sort and paginate. Metrics are 60-day windows. Requires scope `read:ranking`.",
        "parameters": [
          {
            "name": "industry",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "country",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "min_followers",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "max_followers",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "min_score",
            "in": "query",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "score",
                "followers",
                "trend"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of creators.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Creator"
                      }
                    },
                    "next_cursor": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/ranking/industries": {
      "get": {
        "tags": [
          "Ranking"
        ],
        "summary": "List industries",
        "description": "Industries in the ranking with creator counts. Requires scope `read:ranking`.",
        "responses": {
          "200": {
            "description": "Industries.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "industry": {
                        "type": "string"
                      },
                      "count": {
                        "type": "integer"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/credits": {
      "get": {
        "tags": [
          "Credits"
        ],
        "summary": "Get credit balances",
        "description": "Current balances for the three pools: search, AI, and enrichment. Requires scope `read:credits`.",
        "responses": {
          "200": {
            "description": "Balances.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "search": {
                      "$ref": "#/components/schemas/CreditPool"
                    },
                    "ai": {
                      "$ref": "#/components/schemas/CreditPool"
                    },
                    "enrichment": {
                      "$ref": "#/components/schemas/CreditPool"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}