News for hackers. Stuff that matters.

Show HN: Api2ai – create an API agent from any OpenAPI Spec

https://github.com/mquan/api2ai

api2ai parses OpenAPI Spec to generate an agent that can make API calls. For context, I recently need to explore a handful of API suites and thought LLMs can help expedite this process. After some digging, I found OpenAPI Specs are perfect fit for function calling.

Based on a text prompt, api2ai can select the right endpoint and properly parse request params and make api calls. It also handles authentication, currently it supports basic auth, api keys, and bearer token schemes. The tool has helped me explore and see APIs in action without a deep dive into the docs or using postman. It’s open source and hopefully can be useful for you, too.

Please let me know if you have any questions or feedback.

( 5 comments | on HN )
Re:Show HN: Api2ai – create an API agent from any OpenAPI Spec by rattray on Sunday August 06, 2023 @11:30AM (#37022990)
How do you handle very large OpenAPI specs? For example, I think stripe's is over a megabyte. What's the summarization strategy?
Re:Show HN: Api2ai – create an API agent from any OpenAPI Spec by quan on Sunday August 06, 2023 @01:01PM (#37024046)
It’s done in two steps: 1. Create an array of every endpoint’s summary text and ask AI to select one based on the user prompt 2. Use function calling with parameters of the selected operation in step 1
Re:Show HN: Api2ai – create an API agent from any OpenAPI Spec by toomuchtodo on Sunday August 06, 2023 @02:45PM (#37025218)
Would pair nicely with Magic Loops: https://news.ycombinator.com/item?id=36958731
Re:Show HN: Api2ai – create an API agent from any OpenAPI Spec by byteknight on Sunday August 06, 2023 @10:16PM (#37029241)
How might this be different than Langchain open app agent?
Re:Show HN: Api2ai – create an API agent from any OpenAPI Spec by cosbgn on Monday August 07, 2023 @01:32PM (#37037701)
I'm actually working on something similar, but it's a SAAS rather than a library, https://news.ycombinator.com/item?id=37037555 - The benefit is that you don't need hosting or maintenance.