Creating Custom OpenAPI Tools for AI Agents
Published on December 24, 2025 by remii team
Out-of-the-box integrations with popular SaaS tools like GitHub, Slack, and Linear are essential, but they only cover half of a typical enterprise's workflow. The real value of an AI employee unlocks when it can interact with your proprietary databases, internal microservices, and custom-built CRM platforms.
If remii doesn't have a pre-built connector for your bespoke system, you can seamlessly teach your agent how to interact with it by uploading an OpenAPI (formerly Swagger) schema. This enables your AI agent to execute secure, direct queries against your internal architecture.
### The Challenge of Custom Integrations
Historically, integrating a custom API into an AI framework required writing extensive boilerplate code. Developers had to write Python wrappers, define parameter schemas using complex JSON Schema definitions, and manually handle authentication headers. This process was brittle; every time the internal API changed, the wrapper code had to be manually updated, creating a significant maintenance burden.
### Automated Schema Ingestion
remii simplifies this process by natively supporting the OpenAPI 3.0 specification. OpenAPI is the industry standard for designing and documenting RESTful APIs. Most modern backend frameworks (like FastAPI, NestJS, or Spring Boot) automatically generate these schemas.
To connect a custom API to your remii agent: 1. **Upload the Schema**: You upload your internal system's `openapi.json` or `swagger.yaml` file via the remii developer dashboard. 2. **Parsing and Translation**: Our backend engine parses the schema, identifying every available endpoint (GET, POST, PUT, DELETE), path variables, query parameters, and request body structures. 3. **Tool Generation**: The system automatically translates these endpoints into native LLM tool definitions (Function Calling schemas) optimized for models like GPT-4 or Claude 3.5 Sonnet.
The agent instantly learns the capabilities of your API, complete with descriptions and parameter validation rules derived directly from your documentation.
### Configuring Secure Authentication
Internal APIs require robust authentication. remii's custom tool interface allows you to define how the agent should authenticate its requests without hardcoding secrets into the schema.
You can configure: - **API Keys**: Inject keys via HTTP Headers (e.g., `Authorization: Bearer <TOKEN>` or `X-API-Key`). - **Basic Auth**: Standard username and password encoding. - **OAuth 2.0**: For complex enterprise systems, you can define OAuth token URLs and scopes, allowing the agent to manage token lifecycles automatically.
The credentials are encrypted using AES-256 GCM and stored securely in our vault, injected into the API requests only at runtime by the execution orchestrator.
### Agentic Reasoning with Custom APIs
Once connected, the AI agent doesn't just blindly fire requests; it uses its reasoning capabilities to navigate your API.
If you ask the agent to *"Find the contact details for the customer who placed Order #9921"*, and your schema contains a `/orders/{id}` endpoint and a `/users/{id}` endpoint, the agent will: 1. Call `GET /orders/9921` to retrieve the order details. 2. Parse the JSON response to extract the `user_id`. 3. Call `GET /users/{user_id}` to retrieve the contact information. 4. Summarize the final result for you.
This dynamic chaining of API requests allows the agent to perform complex internal investigations and data entry tasks autonomously, effectively acting as an intelligent API orchestrator.
### Maintaining Schema Synchronization
Internal APIs evolve quickly. To ensure your agent never breaks due to outdated schemas, remii supports dynamic schema syncing. Instead of uploading a static file, you can provide a live URL to your staging or production `/openapi.json` endpoint. remii will periodically poll this URL, automatically updating the agent's tool definitions when new endpoints are added or parameters change, ensuring zero-maintenance synchronization.
### Conclusion
By standardizing on OpenAPI schemas, remii empowers engineering teams to extend the capabilities of their AI employees infinitely. Whether you need an agent to query a proprietary vector database, trigger internal Jenkins deployment pipelines, or update records in a custom legacy ERP, automated schema ingestion makes it fast, secure, and effortlessly scalable.