HTTPie AI assistant
Tags: httpie, ai, api, devtools
Published: 2023-01-04 12:24:56

---
title: HTTPie AI assistant
published: true
description: Today we’re launching HTTPie AI, a new way to interact with APIs. HTTPie AI assistant uses state-of-the-art artificial intelligence to help you become more productive.
tags: httpie, ai, apis, devtools
cover_image: https://httpie.io/Images/Share/blog-ai.png
canonical_url: https://httpie.io/blog/ai
---


Today we’re launching HTTPie AI, a new way to interact with APIs ✨

![HTTPie AI in action](https://httpie.io/Images/Blog/ai.gif)

HTTPie AI assistant, built into HTTPie for [Web](https://httpie.io/app)&nbsp;&amp;&nbsp;[Desktop](https://httpie.io/product), uses state-of-the-art artificial intelligence to increase your productivity when testing and talking to APIs.

## Free product preview

This initial release allows you to create requests using human language.  While in preview, you can use HTTPie AI for free with an HTTPie account. Gradually, AI capabilities will expand throughout the platform.

![](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pzdinwvwh2ljdi7fivix.png)



## The problem


Let’s say you want to fetch the details of the [httpie/desktop](https://github.com/httpie/dekstop) repo from the GitHub API. This requires translating the intent to the corresponding HTTP request and entering it into the client’s UI. You need to have some degree of understanding of the following:

* How the API or server works (e.g., hostname, endpoints, auth)
* How HTTP works (e.g., headers, methods, body)
* How to instruct the client to send the exact request

What if instead of creating requests manually, we could tell HTTPie to “fetch repo details of httpie/desktop”? Or even in another language like Spanish, «obtén los detalles del repositorio httpie/desktop»?

Well, now you can!


![](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hfbzrcxxxxtiv073tdel.png)



## Craft requests using human language

You can type your prompt directly in HTTPie’s URL field. It’s similar to typing a search query in your browser’s address bar instead of the exact URL.

Alternatively, you can open the HTTPie AI dialog from the “+” menu in the library. In the desktop app, you can also use <kbd>⌘I</kbd>. There’s a difference in that when you start in the URL field, accepting the generated request will update the one in the current tab instead of creating a new one.


![](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n2shh79cfm6uu6q7mrbi.png)



Then hit “Generate” to get a suggestion.

If you like the request, save it. The saved request automatically gets a short name generated by the AI. If you don’t like it, you can hit “Generate” again, which often produces a different result. You can also try editing the prompt.  If the request includes any placeholders or obvious errors, you can modify it straight from the dialog before saving it (or you can do that after).

There are two strategies for writing HTTPie prompts: *describing the request* and *describing the intent*.

### Describing the request

You can ask the AI to generate an HTTP request by describing its low-level components like the URL, headers, and body:

```ai-prompt
Generate an array of 3 blog posts with title, author, and summary and post it to localhost 3000 api as user agent HTTPie AI
```



![](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/37pxl0ok3nbgnndjdaie.png)



### Describing the intent

For actions involving public APIs of popular services, you can describe the high-level tasks you want to accomplish:

```ai-prompt
List GitHub users
```


![](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ycg2brhtgim40la6bxsf.png)



Here is another example, where the model picks up that we mean a GitHub repo:

```ai-prompt
Fetch last release details of httpie/desktop
```


![](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cu6gn1p923pudubzd98a.png)




### Feedback and accuracy

Like many generative AI applications, the accuracy of the outcome may vary depending on the prompt and other factors. Review the generated request and iterate on the prompt as needed. Higher specificity often leads to better results. You can quickly correct errors directly in the dialog before saving the request. As you use HTTPie AI, please provide quick feedback on the suggestions via the thumb-down and thumb-up buttons to help us fine-tune accuracy.

## Entering the era of AI copilots

As large language models (LLMs) gain robust generative capabilities, creative tools are evolving toward AI-powered experiences.

HTTPie is now becoming the first API development platform with AI assistance, and we’d love your feedback!


![AI copilots: GitHub Copilot, Replit Ghostwriter, Canva Magic Write, Notion AI, HTTPie AI](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3hapsg66uanrg2qncjoi.png)


## How we built it

We built this initial feature preview using OpenAI’s GPT-3 models. 

In the process, we refactored the [openai/openai-python](https://github.com/openai/openai-python) library to make the default installation size [~7⨉&nbsp;smaller](https://github.com/openai/openai-python/pull/153) (167M → 23M). Now it’s much more manageable to deploy OpenAI-powered applications using this library in environments with code size constraints, such as AWS Lambda.

## What’s next

We’ll continue improving the assistant’s accuracy and adding more capabilities throughout the HTTPie platform.

Jump into the [Web](https://httpie.io/app) app or download the [Desktop](https://httpie.io/product) app and check it out!

- ✉️ Thoughts? Questions? Shoot us an email at [feedback@httpie.io](mailto:feedback@httpie.io).
- 📋 You can also help us improve by completing a [quick survey](https://httpie.io/survey).
- 👉 Follow [@httpie](https://twitter.com/httpie) and join our [Discord community](https://httpie.io/discord) to stay up to date.
- 👩‍💻 We’re looking for new colleagues in [engineering and other roles](https://httpie.io/jobs).


PS: We’re looking for a more personable name for our assistant 💡

---

Originally published at https://httpie.io/blog/ai