Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 36 additions & 1 deletion docs/openapi-ingestion.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OpenAPI Ingestion Methods in python-utcp

UTCP automatically converts OpenAPI 2.0/3.0 specifications into UTCP tools, enabling AI agents to interact with REST APIs without requiring server modifications or additional infrastructure.
UTCP automatically converts OpenAPI 2.0/3.0 specifications, plus compatible OpenAPI 3.1 specifications, into UTCP tools, enabling AI agents to interact with REST APIs without requiring server modifications or additional infrastructure.

## Method 1: Direct OpenAPI Converter

Expand Down Expand Up @@ -53,6 +53,40 @@ async def load_remote_spec(url):
manual = await load_remote_spec("https://api.example.com/openapi.json")
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
```

### Xquik API Example

Xquik publishes an OpenAPI 3.1 specification for its X data API at
`https://xquik.com/openapi.json`. It can be loaded the same way as any other
remote OpenAPI document:

```python
manual = await load_remote_spec("https://xquik.com/openapi.json")

print(f"Generated {len(manual.tools)} Xquik tools")
```

When calling authenticated endpoints, provide the API key through the
`x-api-key` header and keep the value in an injected variable:

```python
config = {
"manual_call_templates": [
{
"name": "xquik",
"call_template_type": "http",
"url": "https://xquik.com/openapi.json",
"http_method": "GET",
"auth": {
"auth_type": "api_key",
"api_key": "${XQUIK_API_KEY}",
"var_name": "x-api-key",
"location": "header"
}
}
]
}
```

## Method 3: UTCP Client Configuration

Include OpenAPI specs directly in your UTCP client configuration.
Expand Down Expand Up @@ -137,6 +171,7 @@ OpenAPI security schemes automatically convert to UTCP auth objects:

### Multi-format Support
- **OpenAPI 2.0 & 3.0**: Full compatibility
- **OpenAPI 3.1**: Compatible specifications can be loaded, but verify 3.1-specific schema features against the converter
- **JSON & YAML**: Automatic format detection
- **Local & Remote**: Files or URLs

Expand Down