页面简介
Generate an image from textual input
正文摘录
On this pageText to imageClipdrop is part of Jasper now. For more up to date image models and credits please contact Jasper's team.Contact JasperJasper APISorry, your browser doesn't support embedded videos.Text to Image APITo generate a picture from text, the text to image API is available at https://clipdrop-api.co/text-to-image/v1.The request must be an https POST and its body must be a multipart/form-data with the following fields:a required prompt text field describing the desired image, with a max length of a 1000 characters.In case of success:the response mime-type will be image/png and the response body will be an image with dimensions of 1024x1024 pixels.the response headers will include a x-remaining-credits property to tell you how many credits you have left and a x-credits-consumed property to tell you how many credits were consumed by your request.In case of an error:the response mime-type is application/json, error type is indicated by the response status code and details are in the json body, ie{ "error": "No api key provided" }AuthenticationRequests are authenticated with an API key. If you need one, please contact us at contact@clipdrop.co.If your key has leaked, you can revoke it and request a new one in your account page.FormatsThis API always returns a PNG image.Credits1 successful text to image API call = 1 credit.To buy credits, sign in and select Purchase more credits on your account page.Contact Jasper.ai for more creditsQuota / Rate limitingBy default, each API key has a limit of 60 requests per minute for the text to image API. Please let us know if you'd like higher values.ExamplesCURLJavaScriptPythonSwiftKotlincurl -X POST https://clipdrop-api.co/text-to-image/v1 \ -H 'x-api-key: YOUR_API_KEY' \ -F 'prompt=shot of vaporwave fashion dog in miami' -o result.pngResponses200400401402403406429500The generated image, e.g. SupportAny question ? Contact us.Text to Image APIAuthenticationFormatsCreditsQuota / Rate limitingExamplesResponsesSupport