Skip to content

AmitBerko/bing-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

Bing Image Creator API

Overview

The API allows you to generate images based on a given prompt using Bing's image creator (Powered by Dalle-3).

Initialization

BingApi(cookie: string)

  • Parameters:

    • cookie (string): The account's _U cookie value which is required for authentication.

    In order to obtain your _U cookie follow these steps:

    • Log in to Bing Image Creator
    • Open the browser's developer tools (F12 or right-click and select "Inspect").
    • Navigate to the "Application / Storage" tab.
    • Click on Cookies, then search and copy the value of the _U cookie.
const bingApi = new BingApi('Your _U Cookie Value')

Create Images

createImages(prompt: string, isSlowMode: boolean): Promise<string>

  • Parameters:

    • prompt (string): The prompt for the image generation.
    • isSlowMode (boolean): A flag to indicate whether to use Slow Mode or not.
  • Usage:

    const imagesUrls = await bingApi.createImages('A cat in space', false)
  • Description: Generates images based on the provided prompt. If isSlowMode is set to true, it uses Slow Mode, allowing the generation of prompts without consuming daily credits.

Get Credits

getCredits(): Promise<string>

  • Usage:

    const credits = await bingApi.getCredits()
    console.log(`Current credits: ${credits}`)
  • Returns: A string representing the available credits for prompt generation.

  • Description: Retrieves the number of the current amount of credits the account has.

About

A simple API for Bing's Image Creator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published