This is how you ship your API in 10 sec
On Kuiq, you will write an API with TypeScript and deploy it with one click.
No credit card is required.
By logging in this site you agree to the privacy policy
Step 1: Write TypeScript code
1
import { serve } from "https://deno.land/std@0.131.0/http/server.ts"
2
3
serve(async (req) => {
4
return new Response(JSON.stringify({message: 'hello world!'}), {
5
headers: { "Content-Type": "application/json" },
6
});
7
});
Step 2: Grab your API
https://api.kuiq.io/hello

Use cases

Showing some example of use cases here.
Trying Open AI quickly
https://api.kuiq.io/example-call-openai
1
import "https://deno.land/x/xhr@0.1.0/mod.ts";
2
import { serve } from "https://deno.land/std@0.144.0/http/server.ts"
3
import { Configuration, OpenAIApi } from "https://esm.sh/openai@3.1.0"
4
5
serve(async (req) => {
6
const configuration = new Configuration({
7
apiKey: "<YOUR OPEN AI TOKEN>"
8
});
9
const openai = new OpenAIApi(configuration);
10
11
const response = await openai.createCompletion({
12
model: "text-davinci-002",
13
prompt: "Decide whether a Tweet's sentiment is positive, neutral, or negative.\n\nTweet: \"I loved the new Batman movie!\"\nSentiment:",
14
temperature: 0,
15
max_tokens: 60,
16
top_p: 1,
17
frequency_penalty: 0.5,
18
presence_penalty: 0,
19
});
20
21
return new Response(JSON.stringify(response.data), {
22
headers: { "Content-Type": "application/json" },
23
});
24
});
Create a wrapper endpoint with axios
https://api.kuiq.io/example-axios
1
import 'https://deno.land/x/xhr@0.1.0/mod.ts';
2
import axios from 'https://esm.sh/axios@1.2.0'
3
import { serve } from "https://deno.land/std@0.165.0/http/server.ts"
4
5
serve(async (req) => {
6
const { data } = await axios.get('https://dummyjson.com/products/1');
7
8
return new Response(JSON.stringify(data), {
9
headers: { "Content-Type": "application/json" },
10
});
11
});
By @taishik_