Published on

Building Superface tools with APIs and AI

  • Martyn Davies
    Martyn Davies
    Head of Developer Relations
    Social media profiles

You can now build Superface tools for any API with an Open API Specification and use them in your GPT Actions.

Superface originated from building tools that enabled developers to quickly build use-case-specific API integrations using a particular platform's Open API Specification. This technology was previously available as a command-line interface but now has a new home in the Superface UI.

How it works

If you've been looking for a way to connect your custom GPT to a platform for which Superface doesn't have an integration, you can now build that integration using our browser-based Authoring Hub!

Find an Open API Specification

The key element of creating a tool for Superface is the Open API Specification, which outlines the API capabilities of the platform you want to connect to and use. The Open API Specification is a recognized way of describing an API in a machine-readable way that is widely used in API development.

Some platforms make their OAS publicly available, and others don't have an OAS at all. If the file isn't immediately available from their documentation or GitHub, you can often find it by Googling <platform> open API specification.

For example, the Open API Specification for Resend looks like this and can be found on their GitHub repository. They even wrote a blog post about it!

Add it to Superface

Once you have the OAS for the tool you want to build, you can add it to Superface via the Authoring Hub. This makes Superface aware of the platform you wish to use, its capabilities, and, most importantly, how to connect to it and what security scheme to use when doing so.

Create your use cases

At Superface, we think of a tool's capabilities as "use cases." These are written as natural language prompts that are used alongside the OAS you provided to work out which API endpoint(s) to connect to, what values are required for the rest, and what a successful or erroneous response will look like.

An example of the natural language prompt input in the Superface Authoring Hub

Sometimes, the prompt can be quite simplistic. Other times, it might need a little more detail, especially if you want to ensure that specific values are required or that the responses are sorted in a particular manner. You are not locked into this prompt because you can edit it later if you need to.

After submitting your use case prompt, Superface does its thing.

An example of a use case natural language prompt

Test and edit

Once you have created the tool for your use case, you can test it directly from the browser to see if any changes are required.

An example of the testing and editing section of the Authoring Hub

On the left of the screen is the interface for your use case, written in a language created here at Superface called Comlink, a more human-readable way of describing what is required to successfully make API requests to achieve what you want. Superface uses this interface to create the code executed each time your use case runs.

On the right is, by now, a familiar chat-style interface that is pre-populated with the prompt you submitted for your use case. You can run it directly from this page and test out the tool that was created to see if the response you get is what you're looking for.

From this page, you can edit the initial prompt to make it more specific and the executable code to connect to the external API, giving you complete control over how the tool works.

Of course, you might want to leave it alone and start using it because it works exactly how you need it. That's fine, too.

Ready to build?

If this has piqued your interest, and you don't yet have a Superface account, you can sign up for free here. There's a full tool authoring overview and additional walk-through videos in our documentation.

Automate the impossible.
Superface. The LLM-powered automation agent that connects to all your systems.

Try it now