PHPackages                             ediasoft/midjourney-api-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. ediasoft/midjourney-api-php

ActiveLibrary[HTTP &amp; Networking](/categories/http)

ediasoft/midjourney-api-php
===========================

Midjourney API PHP Client for PHP.

1.1.1(1y ago)398.0k↓50%9[3 issues](https://github.com/eDiasoft/midjourney-api-php/issues)MITPHPPHP ^8.0

Since Aug 4Pushed 1y ago1 watchersCompare

[ Source](https://github.com/eDiasoft/midjourney-api-php)[ Packagist](https://packagist.org/packages/ediasoft/midjourney-api-php)[ RSS](/packages/ediasoft-midjourney-api-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (6)Versions (7)Used By (0)

 [![](https://user-images.githubusercontent.com/7081446/223246488-77debf08-5f0b-47da-b15b-a51b6038352f.png)](https://user-images.githubusercontent.com/7081446/223246488-77debf08-5f0b-47da-b15b-a51b6038352f.png)

Midjourney API client for PHP
=============================

[](#midjourney-api-client-for-php)

[![Midjourney Splash](/.github/images/splash.png)](/.github/images/splash.png)

[ ![yellow-button](https://user-images.githubusercontent.com/7081446/223840887-a22159f2-4830-44d5-ad68-98eaea370e66.png)](https://www.buymeacoffee.com/shuch3n)[![](https://camo.githubusercontent.com/2dbefd5ce41c8a7334a6636a19f88e74514effd3cb0dbebec73032a8e8681e54/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f65646961736f66742f6d69646a6f75726e65792d6170692d706870)](https://camo.githubusercontent.com/2dbefd5ce41c8a7334a6636a19f88e74514effd3cb0dbebec73032a8e8681e54/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f65646961736f66742f6d69646a6f75726e65792d6170692d706870)[![](https://camo.githubusercontent.com/aa401ffaf1a08c2823c9b56078be9f0d426600fa51d14763525530a164b9ea4e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f65646961736f66742f6d69646a6f75726e65792d6170692d706870)](https://camo.githubusercontent.com/aa401ffaf1a08c2823c9b56078be9f0d426600fa51d14763525530a164b9ea4e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f65646961736f66742f6d69646a6f75726e65792d6170692d706870)[![](https://camo.githubusercontent.com/173e79aa7a7585cfb2d529324efc3fc26d5304204a62719133968a0c1a8667f3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f65646961736f66742f6d69646a6f75726e65792d6170692d706870)](https://camo.githubusercontent.com/173e79aa7a7585cfb2d529324efc3fc26d5304204a62719133968a0c1a8667f3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f65646961736f66742f6d69646a6f75726e65792d6170692d706870)

The Midjourney PHP API Client Package is a comprehensive library that allows developers to interact with the Midjourney API through Discord. Midjourney is an AI platform that can generate image base your prompt.

This PHP API client package aims to simplify the integration of the Midjourney API into your PHP applications, enabling you to access the powerful features of the Midjourney platform seamlessly.

Features
--------

[](#features)

- **Imagine:** Create a image base your given prompt. This will return four different options to choose from.
- **Upscale:** Get the full size of the generated image.

### Upcoming release

[](#upcoming-release)

- **Blend:** Able to blend two or more images together.
- **Describe** It will generate four possible prompt base up the given image.
- **Shorten** Analyze your prompt and highlights and it wil suggests unnecessary words you could remove.

Installation
------------

[](#installation)

You can install the Midjourney PHP API Client Package using Composer. Run the following command:

`composer require ediasoft/midjourney-api-php`

Usage
-----

[](#usage)

### Basic usage

[](#basic-usage)

Create a MidjourneyApiClient object with valid credentials and you will be able to access all the available commands. See the Imagine command down below:

```
use eDiasoft\Midjourney\MidjourneyApiClient;

$channel_id = 00000000;
$authorization = "AUTH_TOKEN";

$midjourney = new MidjourneyApiClient($channel_id, $authorization);

$result = $midjourney->imagine('Elephant and a snake romantically having a diner')->send();

return $result;
```

### Constructor

[](#constructor)

- `$channel_id` - Go to your discord channels and right click on the channel where the Midjourney Bot is active on. Click on **Copy Channel ID**[![Copy Channel ID](/.github/images/copy_channel_id.png)](/.github/images/copy_channel_id.png)

    If you don't see this menu option you have to enable developer mode. Go to User Settings &gt; Advanced (Under APP Settings) &gt; Developer Mode (Enabled)

    [![Discord User Token](/.github/images/discord_developer_mode.png)](/.github/images/discord_developer_mode.png)
- `$authorization` - **Caution:** Discord strictly prohibits the use of automatic user accounts, also known as self-bots. Engaging in such activities can lead to the termination of your Discord account if detected. Therefore, we strongly advise against using self-bots to avoid any potential risks and consequences. Please be mindful of Discord's terms of service and use the platform responsibly and within its allowed guidelines.

    To get your user token, go to  and open the **Network** tab inside the **Developers Tools** by pressing op F12. Locate the calls that is directing to the Discord API such as `friend-suggestions` and open the Request Headers tab and locate the `Authorization` and copy this value.

    [![Discord User Token](/.github/images/authorization_header.jpg)](/.github/images/authorization_header.jpg)

### Commands

[](#commands)

#### Imagine

[](#imagine)

```
$imagine_builder = $midjourney->imagine('Elephant and a snake romantically having a diner'); //Returns a Builder object
```

##### Parameters

[](#parameters)

```
$imagine_builder->aspectRatio('16:9') //Changing the aspect ratio.
                ->chaos(30) //The higher the chaos the more unusual and unexpected results.
                ->fast() //Enable fast mode for this single job.
                ->imageWeight(1.75) //Sets image prompt weight relative to text weight. The default value is 1.
                ->no('moon roses') //Exclude specific object in the image.
                ->quality(0.5)
                ->relax() //This will turn on relax mode for this single job, the interval of retrieving the image will be also delayed.
                ->repeat(40) //Create multiple Jobs from a single prompt.
                ->seed(1000) //The Midjourney bot uses a seed number to create a field of visual noise, like television static, as a starting point to generate the initial image grids.
                ->stop(35) //Stopping a Job at an earlier percentage can create blurrier, less detailed results.
                ->style('cute')
                ->stylize(5) //Influences how strongly Midjourney's default aesthetic style is applied
                ->tile() //Generates images that can be used as repeating tiles to create seamless patterns.
                ->turbo() //Override your current setting and run a single job using Turbo Mode.
                ->weird(1000); //Explore unusual aesthetics with the experimental weird parameter

$result = $imagine_builder->send()
```

[Check the documentation for the complete explanation.](https://docs.midjourney.com/docs/parameter-list)

#### Upcale

[](#upcale)

```
$message_id = "1234";
$upscale_image_id = "MJ::JOB::upsample::1::xxxxx";
$interaction_id = $imagine_builder->interactionId(); //You can retrieve this ID after the imagine interaction is performed, this is a identifier for the specific job request.

$upscale_builder = $midjourney->upscale($message_id, $upscale_image_id, $interaction_id); //Returns a Builder object

$upscaled_image_result = $upscale_builder->send();
```

Documentation
-------------

[](#documentation)

For detailed information about the available endpoints and their parameters, please refer to the official [Midjourney documentation](https://docs.midjourney.com/).

Contributing
------------

[](#contributing)

We welcome contributions from the community! If you find any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request on our [GitHub repository](https://github.com/eDiasoft/midjourney-api-php).

License
-------

[](#license)

This package is open-source and released under the MIT License. Feel free to use and modify it according to your project needs.

Support
-------

[](#support)

For any questions or support regarding the Midjourney PHP API Client Package, you can contact us at .

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~76 days

Total

5

Last Release

714d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7081446?v=4)[Shu Chen](/maintainers/shuch3n)[@ShuCh3n](https://github.com/ShuCh3n)

---

Top Contributors

[![ShuCh3n](https://avatars.githubusercontent.com/u/7081446?v=4)](https://github.com/ShuCh3n "ShuCh3n (22 commits)")[![evil1morty](https://avatars.githubusercontent.com/u/42971559?v=4)](https://github.com/evil1morty "evil1morty (3 commits)")

---

Tags

aiapiclienthttpclientimage-generatorlibrarymidjourneyphp

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/ediasoft-midjourney-api-php/health.svg)

```
[![Health](https://phpackages.com/badges/ediasoft-midjourney-api-php/health.svg)](https://phpackages.com/packages/ediasoft-midjourney-api-php)
```

###  Alternatives

[abraham/twitteroauth

The most popular PHP library for use with the Twitter OAuth REST API.

4.3k15.9M128](/packages/abraham-twitteroauth)[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78026.4M414](/packages/react-http)[php-http/curl-client

PSR-18 and HTTPlug Async client with cURL

48347.0M384](/packages/php-http-curl-client)[smi2/phpclickhouse

PHP ClickHouse Client

84310.1M71](/packages/smi2-phpclickhouse)[padraic/humbug_get_contents

Secure wrapper for accessing HTTPS resources with file\_get\_contents for PHP 5.3+

1255.3M5](/packages/padraic-humbug-get-contents)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
