OpenAPI to Agent Tools Converter
Pricing
from $5.00 / 1,000 spec converteds
Go to Apify Store
OpenAPI to Agent Tools Converter
Pricing
from $5.00 / 1,000 spec converteds
You can access the OpenAPI to Agent Tools Converter programmatically from your own applications by using the Apify API. You can also choose the language preference from below. To use the Apify API, you’ll need an Apify account and your API token, found in API & Integrations in Apify Console.
1import { ApifyClient } from 'apify-client';2
3// Initialize the ApifyClient with your Apify API token4// Replace the '<YOUR_API_TOKEN>' with your token5const client = new ApifyClient({6 token: '<YOUR_API_TOKEN>',7});8
9// Prepare Actor input10const input = {11 "items": [12 {13 "openapi": "3.0.0",14 "info": {15 "title": "Pet Store API",16 "version": "1.0.0",17 "description": "A sample API for testing tool generation."18 },19 "paths": {20 "/pets": {21 "get": {22 "operationId": "listPets",23 "summary": "List all pets",24 "description": "Returns a list of pets with optional limit filter.",25 "parameters": [26 {27 "name": "limit",28 "in": "query",29 "description": "How many items to return at one time (max 100)",30 "required": false,31 "schema": {32 "type": "integer",33 "format": "int32"34 }35 }36 ]37 },38 "post": {39 "operationId": "createPet",40 "summary": "Create a pet",41 "description": "Creates a new pet in the store.",42 "requestBody": {43 "required": true,44 "content": {45 "application/json": {46 "schema": {47 "type": "object",48 "required": [49 "name"50 ],51 "properties": {52 "name": {53 "type": "string",54 "description": "The name of the pet"55 },56 "tag": {57 "type": "string",58 "description": "Optional category tag"59 }60 }61 }62 }63 }64 }65 }66 }67 }68 }69 ],70 "target_formats": [71 "openai",72 "anthropic",73 "gemini",74 "mcp"75 ]76};77
78// Run the Actor and wait for it to finish79const run = await client.actor("n4d.h1dr/openapi-to-agent-tools").call(input);80
81// Fetch and print Actor results from the run's dataset (if any)82console.log('Results from dataset');83console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);84const { items } = await client.dataset(run.defaultDatasetId).listItems();85items.forEach((item) => {86 console.dir(item);87});88
89// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docsThe Apify API client for JavaScript is the official library that allows you to use OpenAPI to Agent Tools Converter API in JavaScript or TypeScript, providing convenience functions and automatic retries on errors.
Install the apify-client
$npm install apify-clientOther API clients include: