{
  "openapi": "3.1.1",
  "info": {
    "title": "Officeloft SDP \u0026 ICE Inspector API",
    "version": "1.0.0",
    "summary": "Read a WebRTC offer, answer or ICE candidates: media, codecs, encryption and connection paths.",
    "description": "Every endpoint performs the same calculation as the human page and returns inputs, result, units, assumptions, sources, warnings and computedAt. MCP endpoint: /mcp."
  },
  "servers": [
    {
      "url": "https://officeloftsdpinspector.usefulweb.app"
    }
  ],
  "paths": {
    "/api/v1/calculate": {
      "post": {
        "operationId": "calculate",
        "summary": "Read a WebRTC offer, answer or ICE candidates: media, codecs, encryption and connection paths.",
        "description": "Paste a WebRTC session description (SDP offer or answer, also as JSON) or ICE candidate lines, for example from chrome://webrtc-internals or a call log. The inspector lists the media sections with direction and codecs, the DTLS fingerprint and setup role, BUNDLE groups and every candidate with its type, protocol and address kind, then says which connection paths exist — same network, through NAT, or through a TURN relay — and warns about what would make a call fail.\n\nMethodology:\n- The text is split into SDP lines (type=value). Session-level attributes (fingerprint, setup, ICE credentials) apply to every media section that does not override them; codecs come from the m= line payload list joined with a=rtpmap and a=fmtp.\n- Candidates follow the grammar of RFC 8839: foundation, component, transport, priority, address, port, typ host/srflx/prflx/relay, and the optional raddr/rport/tcptype. Addresses ending in “.local” are mDNS names that browsers use to hide local IP addresses.\n- Connection paths: host candidates work on the same network, server-reflexive (srflx) and peer-reflexive (prflx) candidates work through most NAT routers, relay candidates go through a TURN server and also work behind symmetric NAT and strict firewalls (RFC 8445).\n- Checks: missing DTLS fingerprint or ICE credentials (browsers refuse the description), audio without Opus or video without VP8/H.264 (the codecs every WebRTC browser must support), missing rtcp-mux, several sections without BUNDLE, trickle ICE without candidates, no relay or only host candidates.\n- ICE passwords are never shown (only their length). With “Hide the last part of IP addresses” the last octet of IPv4 addresses and everything after the second group of IPv6 addresses is replaced.\n\nThe inspector reads the text you paste; it does not connect to anybody. A description that looks fine can still fail when firewalls block the listed paths.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "officeloft_sdp_inspector",
        "x-owner-app": "officeloft",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OfficeloftSdpInspectorInput"
              },
              "examples": {
                "example1": {
                  "summary": "Browser offer with audio, video and a relay candidate",
                  "value": {
                    "sdp": "v=0\r\no=- 4611731400430051336 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE 0 1\r\na=extmap-allow-mixed\r\na=msid-semantic: WMS\r\nm=audio 9 UDP/TLS/RTP/SAVPF 111 63 9 0 8\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=candidate:1467250027 1 udp 2122260223 4f2b6b1e-9d3c-4c3e-8f0c-2a8e1f5b7c11.local 54400 typ host generation 0\r\na=candidate:842163049 1 udp 1686052607 198.51.100.23 54400 typ srflx raddr 0.0.0.0 rport 0 generation 0\r\na=candidate:3022914911 1 udp 41885439 203.0.113.10 49170 typ relay raddr 198.51.100.23 rport 54400 generation 0\r\na=ice-ufrag:Hk3x\r\na=ice-pwd:3Jx8dY2nQm1pZ7vR4tL9wK0e\r\na=ice-options:trickle\r\na=fingerprint:sha-256 6B:8B:5D:EA:59:04:20:23:29:C8:87:1C:CA:51:F4:5A:2B:9E:11:47:6E:57:8C:2D:61:0C:94:59:1F:41:6D:B3\r\na=setup:actpass\r\na=mid:0\r\na=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level\r\na=sendrecv\r\na=rtcp-mux\r\na=rtpmap:111 opus/48000/2\r\na=fmtp:111 minptime=10;useinbandfec=1\r\na=rtpmap:63 red/48000/2\r\na=rtpmap:9 G722/8000\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=ssrc:1001 cname:officeloftExample\r\nm=video 9 UDP/TLS/RTP/SAVPF 96 97 102 103\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:Hk3x\r\na=ice-pwd:3Jx8dY2nQm1pZ7vR4tL9wK0e\r\na=ice-options:trickle\r\na=fingerprint:sha-256 6B:8B:5D:EA:59:04:20:23:29:C8:87:1C:CA:51:F4:5A:2B:9E:11:47:6E:57:8C:2D:61:0C:94:59:1F:41:6D:B3\r\na=setup:actpass\r\na=mid:1\r\na=extmap:2 urn:ietf:params:rtp-hdrext:toffset\r\na=sendrecv\r\na=rtcp-mux\r\na=rtcp-rsize\r\na=rtpmap:96 VP8/90000\r\na=rtpmap:97 rtx/90000\r\na=fmtp:97 apt=96\r\na=rtpmap:102 H264/90000\r\na=fmtp:102 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42001f\r\na=rtpmap:103 rtx/90000\r\na=fmtp:103 apt=102\r\na=ssrc:2002 cname:officeloftExample"
                  }
                },
                "example2": {
                  "summary": "ICE candidates without a relay",
                  "value": {
                    "sdp": "candidate:1467250027 1 udp 2122260223 192.168.1.20 54400 typ host generation 0\ncandidate:1467250028 1 tcp 1518280447 192.168.1.20 9 typ host tcptype active generation 0\ncandidate:842163049 1 udp 1686052607 198.51.100.23 54400 typ srflx raddr 192.168.1.20 rport 54400 generation 0",
                    "mask": false
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OfficeloftSdpInspectorResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tool": {
      "get": {
        "operationId": "getToolDefinition",
        "summary": "Inputs, output schema and examples for this tool",
        "responses": {
          "200": {
            "description": "Tool definition.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Problem": {
        "type": "object",
        "description": "RFC 9457 problem details. 422 responses include per-field `errors`.",
        "required": [
          "type",
          "title",
          "status",
          "detail"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "field",
                "message"
              ],
              "properties": {
                "field": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "OfficeloftSdpInspectorInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "sdp": {
            "title": "Session description or candidates",
            "description": "An SDP starting with “v=0”, a {\"type\",\"sdp\"} JSON object, or one ICE candidate per line.",
            "type": "string",
            "maxLength": 200000,
            "default": ""
          },
          "mask": {
            "title": "Hide the last part of IP addresses",
            "description": "Recommended before you share the result: 198.51.100.23 becomes 198.51.100.x.",
            "type": "boolean",
            "default": true
          }
        },
        "required": []
      },
      "OfficeloftSdpInspectorResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemaVersion",
          "tool",
          "computedAt",
          "inputs",
          "summary",
          "result",
          "units",
          "assumptions",
          "sources",
          "warnings",
          "presentation",
          "links"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1.0"
          },
          "tool": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "version"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            }
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "inputs": {
            "type": "object",
            "description": "Normalised inputs actually used, including applied defaults."
          },
          "summary": {
            "type": "string"
          },
          "result": {
            "type": "object"
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "retrievedAt": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "presentation": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Display blocks used by the human page (same data)."
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "human",
              "api",
              "openapi",
              "methodology"
            ],
            "properties": {
              "human": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "methodology": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      }
    }
  }
}