Skip to content

OpenAPI Connector

The OpenAPI connector turns any API with an OpenAPI (Swagger) specification into a set of tools the AI agent can discover and invoke. It provides 6 tools for parsing specs, listing endpoints, and executing API calls.

Configuration

Provide the URL or raw content of an OpenAPI spec (v2 or v3):

URL-Based

json
{
  "name": "Internal API",
  "source_type": "openapi",
  "config": {
    "spec_url": "https://api.example.com/openapi.json",
    "base_url": "https://api.example.com",
    "auth_header": "Authorization",
    "auth_value": "Bearer your-api-token"
  }
}

Inline Spec

json
{
  "name": "Partner API",
  "source_type": "openapi",
  "config": {
    "spec_content": "openapi: '3.0.0'\ninfo:\n  title: Partner API\n  version: '1.0'\npaths:\n  /users:\n    get:\n      summary: List users\n      ...",
    "base_url": "https://partner-api.example.com",
    "auth_header": "X-API-Key",
    "auth_value": "key-xxxxx"
  }
}

Authentication Methods

The OpenAPI connector supports multiple authentication strategies:

MethodConfig FieldsExample
Bearer Tokenauth_header, auth_valueAuthorization: Bearer xxx
API Key (Header)auth_header, auth_valueX-API-Key: xxx
API Key (Query)auth_query_param, auth_value?api_key=xxx
Basic Authauth_header, auth_valueAuthorization: Basic base64(user:pass)
No Auth--Public APIs

Live Tools (6)

ToolDescriptionArguments
openapi_parse_specParse and validate an OpenAPI spec, returning summary infospec_url?
openapi_list_endpointsList all endpoints with methods, paths, and descriptionstag?, method?
openapi_get_endpointGet detailed endpoint info including parameters and schemasmethod, path
openapi_executeExecute an API call to a specific endpointmethod, path, params?, body?, headers?
openapi_list_schemasList all schema definitions in the spec--
openapi_get_schemaGet a specific schema definition with properties and examplesschema_name

Example: Agent Using OpenAPI Tools

User: "What endpoints does the payments API have for refunds?"

Agent: Let me check the API spec.
→ Calls openapi_list_endpoints(tag: "refunds")
→ Returns:
  POST /refunds — Create a refund
  GET /refunds/{id} — Get refund details
  GET /refunds — List refunds with filters
→ Calls openapi_get_endpoint(method: "POST", path: "/refunds")
→ Returns: request body schema, required fields, response schema
→ Summarizes the refund API capabilities

ETL Ingestion

Nodes Created

Node LabelPropertiesSource
APISpectitle, version, description, base_url, format (openapi/swagger)Spec info
APIEndpointmethod, path, summary, description, tags, deprecatedPaths
APIParametername, in (query/path/header/cookie), required, type, descriptionParameters
APISchemaname, type, properties, required_fieldsComponents/Definitions

Relationships Created

RelationshipFromTo
DEFINESAPISpecAPIEndpoint
HAS_PARAMETERAPIEndpointAPIParameter
ACCEPTSAPIEndpointAPISchema (request body)
RETURNSAPIEndpointAPISchema (response)
REFERENCESAPISchemaAPISchema (nested/allOf/oneOf)

Graph Queries

cypher
-- Find all endpoints that accept a specific schema
MATCH (e:APIEndpoint)-[:ACCEPTS]->(s:APISchema)
WHERE s.name = "CreateOrderRequest"
RETURN e.method, e.path, e.summary

-- Map API coverage: endpoints with and without descriptions
MATCH (e:APIEndpoint)
RETURN e.method, e.path,
       CASE WHEN e.description IS NOT NULL THEN "documented" ELSE "undocumented" END AS status

-- Find deprecated endpoints still in use
MATCH (e:APIEndpoint)
WHERE e.deprecated = true
RETURN e.method, e.path, e.summary

Configuration Reference

FieldTypeDefaultDescription
spec_urlstring--URL to fetch the OpenAPI spec from
spec_contentstring--Inline OpenAPI spec (YAML or JSON)
base_urlstringfrom specOverride the base URL for API calls
auth_headerstring--Authentication header name
auth_valuestring--Authentication header value
auth_query_paramstring--Authentication query parameter name
verify_sslbooltrueVerify SSL certificates for API calls
timeout_secsint30Request timeout for API execution
max_response_size_kbint1024Maximum response size to process

TIP

You must provide either spec_url or spec_content — not both. If the spec contains a servers block, the base_url is auto-detected. You can override it when the spec URL differs from the runtime API URL.

Supported Spec Formats

FormatVersionSupport
OpenAPI3.1Full
OpenAPI3.0Full
Swagger2.0Full (auto-converted to 3.0 internally)
JSON--Full
YAML--Full

Troubleshooting

ErrorCauseFix
Failed to parse specInvalid OpenAPI/Swagger formatValidate the spec with editor.swagger.io
Connection refusedSpec URL or base URL is unreachableVerify the URL and network connectivity
401 UnauthorizedAPI authentication failedCheck the auth_header and auth_value configuration
SSL certificate errorSelf-signed or expired certificateSet verify_ssl: false (not recommended for production)
Response too largeAPI response exceeds max_response_size_kbIncrease the limit or use query parameters to reduce the response

Built by AgentcyLabs. For in-house deployment or Agentcy Cloud (PaaS) access, visit agentcylabs.com.