import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
apimage: {
type: "app",
app: "apimage",
}
},
async run({steps, $}) {
const data = {
"prompt": `Generate an image depicting a modern workspace with clean design elements. Include a laptop, coffee mug, and subtle ambient lighting. `,
}
return await axios($, {
method: "post",
url: `https://apimage.org/api/ai-image-generate`,
headers: {
Authorization: `Bearer ${this.apimage.$auth.api_key}`,
"accept": `application/json`,
},
data,
})
},
})
APImage uses API keys for authentication. When you connect your APImage account, Pipedream securely stores the keys so you can easily authenticate to APImage APIs in both code and no-code steps.