# BRAINIAC GraphQL Subgraph Complexity Analyzer

> BRAINIAC GraphQL Subgraph Complexity Analyzer is a paid API for AI agents from www.brainiac.software, paid per call via x402, $0.04/call, status unknown (last checked 2026-11-13).

Analyzes a GraphQL SDL schema to compute subgraph complexity, exposure risk score, and introspection settings for security assessment.

## Facts

- Endpoint: POST https://www.brainiac.software/api/v1/graphql-security/subgraph-complexity?utm_source=zero.xyz
- Price: $0.04/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/brainiac-graphql-subgraph-complexity-analyzer-1c16491b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_TLXe5XWll3Ee6ZpGo7CV0

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability brainiac-graphql-subgraph-complexity-analyzer-1c16491b -d '<json body>'
```

Example prompt: Analyze this GraphQL SDL schema for security risks — set max depth to 10 and introspection to enabled — and tell me the exposure risk score and query complexity index: `type Query { user(id: ID!): User } type User { id: ID! posts: [Post] } type Post { id: ID! comments: [Comment] } type Comment { id: ID! body: String }`

## When to prefer this

Choose this endpoint when you need a fast, pay-per-call security audit of a GraphQL schema without setting up an account — especially useful for CI/CD pipelines, compliance checks, or one-off third-party schema reviews. Prefer it over full API security platforms when you only need complexity and exposure scoring rather than runtime monitoring or traffic analysis.

## Known failure modes

- Invalid or unparseable SDL returns a 400 error
- SDL exceeding 50,000 characters is rejected
- max_depth outside the 1–20 range causes a validation error
- Missing required sdl field returns a 400 bad request
- Payment failure via x402 results in a 402 Payment Required response

## How this service works

Pay-per-call APIs for AI agents: OFAC sanctions screening, compliance checks, token security, and Base chain data via x402. No account. Fixed USDC price. MCP-ready.

## Output

Returns a JSON object with an exposure_risk_score (integer 0–100 indicating how risky the schema is) and a max_query_complexity_index (integer representing the highest possible query complexity based on the schema structure and depth limits).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "sdl": {
   "type": "string",
   "maxLength": 50000,
   "minLength": 1
  },
  "max_depth": {
   "type": "integer",
   "maximum": 20,
   "minimum": 1
  },
  "introspection": {
   "enum": [
    "enabled",
    "disabled"
   ],
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "exposure_risk_score": 85,
  "max_query_complexity_index": 2
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/brainiac-graphql-subgraph-complexity-analyzer-1c16491b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from www.brainiac.software](https://www.zero.xyz/host/www.brainiac.software/llms.txt)
