//native
type Recraft = {
apiKey: string
}
/**
* Get ping
*
*/
export async function main(auth: Recraft) {
const url = new URL(`https://external.api.recraft.ai/ping`)
const response = await fetch(url, {
method: 'GET',
body: undefined
})
if (!response.ok) {
const text = await response.text()
throw new Error(`${response.status} ${text}`)
}
return await response.text()
}
Submitted by hugo697 428 days ago