legnext-ruby-sdk 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +21 -0
  3. data/README.md +129 -0
  4. data/lib/openapi_client/api/account_management_api.rb +82 -0
  5. data/lib/openapi_client/api/image_api.rb +821 -0
  6. data/lib/openapi_client/api/video_api.rb +289 -0
  7. data/lib/openapi_client/api_client.rb +396 -0
  8. data/lib/openapi_client/api_error.rb +58 -0
  9. data/lib/openapi_client/api_model_base.rb +88 -0
  10. data/lib/openapi_client/configuration.rb +301 -0
  11. data/lib/openapi_client/models/api_v1_diffusion_post200_response.rb +205 -0
  12. data/lib/openapi_client/models/api_v1_diffusion_post200_response_config.rb +156 -0
  13. data/lib/openapi_client/models/api_v1_diffusion_post200_response_config_webhook_config.rb +156 -0
  14. data/lib/openapi_client/models/api_v1_diffusion_post200_response_meta.rb +156 -0
  15. data/lib/openapi_client/models/api_v1_diffusion_post200_response_meta_usage.rb +165 -0
  16. data/lib/openapi_client/models/api_v1_diffusion_post200_response_output.rb +168 -0
  17. data/lib/openapi_client/models/api_v1_edit_post200_response.rb +205 -0
  18. data/lib/openapi_client/models/api_v1_job_job_id_get200_response.rb +246 -0
  19. data/lib/openapi_client/models/api_v1_job_job_id_get200_response_error.rb +175 -0
  20. data/lib/openapi_client/models/api_v1_job_job_id_get200_response_meta.rb +174 -0
  21. data/lib/openapi_client/models/api_v1_job_job_id_get200_response_output.rb +177 -0
  22. data/lib/openapi_client/models/api_v1_job_job_id_get200_response_output_available_actions.rb +224 -0
  23. data/lib/openapi_client/models/api_v1_pan_post200_response.rb +205 -0
  24. data/lib/openapi_client/models/balance_response.rb +167 -0
  25. data/lib/openapi_client/models/balance_response_data.rb +208 -0
  26. data/lib/openapi_client/models/task_response.rb +206 -0
  27. data/lib/openapi_client/version.rb +15 -0
  28. data/lib/openapi_client.rb +59 -0
  29. metadata +115 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 419e82e0428dcffca736aab351cb86436c820da06c295ac76b9fddf300c0a05e
4
+ data.tar.gz: d752c8d92662c3ca17ee80858e449d9a844e5d2327a6ec9c6ef4c1b29980bc84
5
+ SHA512:
6
+ metadata.gz: d72b1c77790d440e6c2518fd07472d86553d4a2f787b1385dc338cb4f8ac25048ca86766293e9bb5c30d39cddd007c3c93b46e9d658385c49d05c4b0c9a14faa
7
+ data.tar.gz: 58705ba2c57705e189378abcf6655faac574455874e4c5598e246a778aaf6c1a74c0edd767d971a82182a5d478372a92cf64328c2ed521a36a392d6ad4b2b1ef
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Legnext AI
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,129 @@
1
+ # openapi_client
2
+
3
+ OpenapiClient - the Ruby gem for the Midjourney api-unofficial by Legnext.ai
4
+
5
+ # **Legnext.ai Midjourney API: The Ultimate AI Image Generation Toolkit**
6
+
7
+ Unlock the full creative potential of Midjourney directly within your applications and development workflows using the **Legnext.ai Midjourney API (Unofficial)**. This comprehensive collection offers a ready-to-integrate solution for professional image and video creation, manipulation, and high-fidelity upscaling.
8
+
9
+ We provide developers with **stable, high-performance API access** to the Midjourney model. Crucially, integrating our service requires **no Midjourney account**, eliminating the hassle of managing official subscriptions or Discord interactions. Our toolkit simplifies the entire text-to-image process, supporting complex prompts, aspect ratio adjustments, and advanced style parameters.
10
+
11
+ Focus on innovation while we handle the AI infrastructure. Start building scalable, visually stunning applications today with reliable access to the world’s leading generative AI model.
12
+
13
+ This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
14
+
15
+ - API version: 1.0.0
16
+ - Package version: 1.0.0
17
+ - Generator version: 7.18.0
18
+ - Build package: org.openapitools.codegen.languages.RubyClientCodegen
19
+
20
+ ## Installation
21
+
22
+ ### Build a gem
23
+
24
+ To build the Ruby code into a gem:
25
+
26
+ ```shell
27
+ gem build openapi_client.gemspec
28
+ ```
29
+
30
+ Then either install the gem locally:
31
+
32
+ ```shell
33
+ gem install ./openapi_client-1.0.0.gem
34
+ ```
35
+
36
+ (for development, run `gem install --dev ./openapi_client-1.0.0.gem` to install the development dependencies)
37
+
38
+ or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
39
+
40
+ Finally add this to the Gemfile:
41
+
42
+ gem 'openapi_client', '~> 1.0.0'
43
+
44
+ ### Install from Git
45
+
46
+ If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:
47
+
48
+ gem 'openapi_client', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
49
+
50
+ ### Include the Ruby code directly
51
+
52
+ Include the Ruby code directly using `-I` as follows:
53
+
54
+ ```shell
55
+ ruby -Ilib script.rb
56
+ ```
57
+
58
+ ## Getting Started
59
+
60
+ Please follow the [installation](#installation) procedure and then run the following code:
61
+
62
+ ```ruby
63
+ # Load the gem
64
+ require 'openapi_client'
65
+
66
+ api_instance = OpenapiClient::AccountManagementApi.new
67
+ opts = {
68
+ x_api_key: 'x_api_key_example' # String |
69
+ }
70
+
71
+ begin
72
+ #get account balance
73
+ result = api_instance.api_account_balance_get(opts)
74
+ p result
75
+ rescue OpenapiClient::ApiError => e
76
+ puts "Exception when calling AccountManagementApi->api_account_balance_get: #{e}"
77
+ end
78
+
79
+ ```
80
+
81
+ ## Documentation for API Endpoints
82
+
83
+ All URIs are relative to *https://api.legnext.ai*
84
+
85
+ Class | Method | HTTP request | Description
86
+ ------------ | ------------- | ------------- | -------------
87
+ *OpenapiClient::AccountManagementApi* | [**api_account_balance_get**](docs/AccountManagementApi.md#api_account_balance_get) | **GET** /api/account/balance | get account balance
88
+ *OpenapiClient::ImageApi* | [**api_v1_blend_post**](docs/ImageApi.md#api_v1_blend_post) | **POST** /api/v1/blend | Blend
89
+ *OpenapiClient::ImageApi* | [**api_v1_describe_post**](docs/ImageApi.md#api_v1_describe_post) | **POST** /api/v1/describe | Describe
90
+ *OpenapiClient::ImageApi* | [**api_v1_diffusion_post**](docs/ImageApi.md#api_v1_diffusion_post) | **POST** /api/v1/diffusion | Diffusion
91
+ *OpenapiClient::ImageApi* | [**api_v1_edit_post**](docs/ImageApi.md#api_v1_edit_post) | **POST** /api/v1/edit | Edit
92
+ *OpenapiClient::ImageApi* | [**api_v1_inpaint_post**](docs/ImageApi.md#api_v1_inpaint_post) | **POST** /api/v1/inpaint | Inpaint
93
+ *OpenapiClient::ImageApi* | [**api_v1_outpaint_post**](docs/ImageApi.md#api_v1_outpaint_post) | **POST** /api/v1/outpaint | Outpaint
94
+ *OpenapiClient::ImageApi* | [**api_v1_pan_post**](docs/ImageApi.md#api_v1_pan_post) | **POST** /api/v1/pan | Pan
95
+ *OpenapiClient::ImageApi* | [**api_v1_remix_post**](docs/ImageApi.md#api_v1_remix_post) | **POST** /api/v1/remix | Remix
96
+ *OpenapiClient::ImageApi* | [**api_v1_reroll_post**](docs/ImageApi.md#api_v1_reroll_post) | **POST** /api/v1/reroll | Reroll
97
+ *OpenapiClient::ImageApi* | [**api_v1_shorten_post**](docs/ImageApi.md#api_v1_shorten_post) | **POST** /api/v1/shorten | Shorten
98
+ *OpenapiClient::ImageApi* | [**api_v1_upscale_post**](docs/ImageApi.md#api_v1_upscale_post) | **POST** /api/v1/upscale | Upscale
99
+ *OpenapiClient::ImageApi* | [**api_v1_variation_post**](docs/ImageApi.md#api_v1_variation_post) | **POST** /api/v1/variation | Variation
100
+ *OpenapiClient::VideoApi* | [**api_v1_extend_video_post**](docs/VideoApi.md#api_v1_extend_video_post) | **POST** /api/v1/extend-video | Extend Video
101
+ *OpenapiClient::VideoApi* | [**api_v1_job_job_id_get**](docs/VideoApi.md#api_v1_job_job_id_get) | **GET** /api/v1/job/{job_id} | Get task response
102
+ *OpenapiClient::VideoApi* | [**api_v1_video_diffusion_post**](docs/VideoApi.md#api_v1_video_diffusion_post) | **POST** /api/v1/video-diffusion | Video Diffusion
103
+ *OpenapiClient::VideoApi* | [**api_v1_video_upscale_post**](docs/VideoApi.md#api_v1_video_upscale_post) | **POST** /api/v1/video-upscale | Video Upscale
104
+
105
+
106
+ ## Documentation for Models
107
+
108
+ - [OpenapiClient::ApiV1DiffusionPost200Response](docs/ApiV1DiffusionPost200Response.md)
109
+ - [OpenapiClient::ApiV1DiffusionPost200ResponseConfig](docs/ApiV1DiffusionPost200ResponseConfig.md)
110
+ - [OpenapiClient::ApiV1DiffusionPost200ResponseConfigWebhookConfig](docs/ApiV1DiffusionPost200ResponseConfigWebhookConfig.md)
111
+ - [OpenapiClient::ApiV1DiffusionPost200ResponseMeta](docs/ApiV1DiffusionPost200ResponseMeta.md)
112
+ - [OpenapiClient::ApiV1DiffusionPost200ResponseMetaUsage](docs/ApiV1DiffusionPost200ResponseMetaUsage.md)
113
+ - [OpenapiClient::ApiV1DiffusionPost200ResponseOutput](docs/ApiV1DiffusionPost200ResponseOutput.md)
114
+ - [OpenapiClient::ApiV1EditPost200Response](docs/ApiV1EditPost200Response.md)
115
+ - [OpenapiClient::ApiV1JobJobIdGet200Response](docs/ApiV1JobJobIdGet200Response.md)
116
+ - [OpenapiClient::ApiV1JobJobIdGet200ResponseError](docs/ApiV1JobJobIdGet200ResponseError.md)
117
+ - [OpenapiClient::ApiV1JobJobIdGet200ResponseMeta](docs/ApiV1JobJobIdGet200ResponseMeta.md)
118
+ - [OpenapiClient::ApiV1JobJobIdGet200ResponseOutput](docs/ApiV1JobJobIdGet200ResponseOutput.md)
119
+ - [OpenapiClient::ApiV1JobJobIdGet200ResponseOutputAvailableActions](docs/ApiV1JobJobIdGet200ResponseOutputAvailableActions.md)
120
+ - [OpenapiClient::ApiV1PanPost200Response](docs/ApiV1PanPost200Response.md)
121
+ - [OpenapiClient::BalanceResponse](docs/BalanceResponse.md)
122
+ - [OpenapiClient::BalanceResponseData](docs/BalanceResponseData.md)
123
+ - [OpenapiClient::TaskResponse](docs/TaskResponse.md)
124
+
125
+
126
+ ## Documentation for Authorization
127
+
128
+ Endpoints do not require authorization.
129
+
@@ -0,0 +1,82 @@
1
+ =begin
2
+ #Midjourney api-unofficial by Legnext.ai
3
+
4
+ ## **Legnext.ai Midjourney API: The Ultimate AI Image Generation Toolkit** Unlock the full creative potential of Midjourney directly within your applications and development workflows using the **Legnext.ai Midjourney API (Unofficial)**. This comprehensive collection offers a ready-to-integrate solution for professional image and video creation, manipulation, and high-fidelity upscaling. We provide developers with **stable, high-performance API access** to the Midjourney model. Crucially, integrating our service requires **no Midjourney account**, eliminating the hassle of managing official subscriptions or Discord interactions. Our toolkit simplifies the entire text-to-image process, supporting complex prompts, aspect ratio adjustments, and advanced style parameters. Focus on innovation while we handle the AI infrastructure. Start building scalable, visually stunning applications today with reliable access to the world’s leading generative AI model.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.18.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module OpenapiClient
16
+ class AccountManagementApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # get account balance
23
+ # ## Retrieve Account Balance and Credit Information Get your current account balance, available credits, points, and low balance alert settings. Essential for monitoring usage and managing costs. ### How it Works Make a GET request to retrieve current account status. The API returns real-time balance information, available credits for API usage, and alert settings. ### Required Parameters None - this is a simple GET request with authentication ### Authentication Requires a valid API key passed in the `x-api-key` header (note: some implementations use `X-API-KEY`). ### Response Returns account balance information including: - `account_id` - Your account identifier - `balance_usd` - Current balance in USD - `available_credits` - Credits available for API usage - `available_points` - Points balance - `alert_threshold` - Low balance alert threshold (USD) - `low_balance_alert` - Whether low balance alert is triggered - `updated_at` - Last update timestamp ### Use Cases - Monitor remaining credits before large batch operations - Set up automated balance monitoring in applications - Verify successful credit purchases or additions - Track usage and spending over time - Implement low-balance warnings in applications ### Tips - Check balance before large batch operations to avoid interruptions - Balance is in USD, credits are usage tokens - Low balance alert threshold can be configured in dashboard - Updated in real-time - reflects immediate usage - Use for cost monitoring and budget management
24
+ # @param [Hash] opts the optional parameters
25
+ # @option opts [String] :x_api_key
26
+ # @return [BalanceResponse]
27
+ def api_account_balance_get(opts = {})
28
+ data, _status_code, _headers = api_account_balance_get_with_http_info(opts)
29
+ data
30
+ end
31
+
32
+ # get account balance
33
+ # ## Retrieve Account Balance and Credit Information Get your current account balance, available credits, points, and low balance alert settings. Essential for monitoring usage and managing costs. ### How it Works Make a GET request to retrieve current account status. The API returns real-time balance information, available credits for API usage, and alert settings. ### Required Parameters None - this is a simple GET request with authentication ### Authentication Requires a valid API key passed in the `x-api-key` header (note: some implementations use `X-API-KEY`). ### Response Returns account balance information including: - `account_id` - Your account identifier - `balance_usd` - Current balance in USD - `available_credits` - Credits available for API usage - `available_points` - Points balance - `alert_threshold` - Low balance alert threshold (USD) - `low_balance_alert` - Whether low balance alert is triggered - `updated_at` - Last update timestamp ### Use Cases - Monitor remaining credits before large batch operations - Set up automated balance monitoring in applications - Verify successful credit purchases or additions - Track usage and spending over time - Implement low-balance warnings in applications ### Tips - Check balance before large batch operations to avoid interruptions - Balance is in USD, credits are usage tokens - Low balance alert threshold can be configured in dashboard - Updated in real-time - reflects immediate usage - Use for cost monitoring and budget management
34
+ # @param [Hash] opts the optional parameters
35
+ # @option opts [String] :x_api_key
36
+ # @return [Array<(BalanceResponse, Integer, Hash)>] BalanceResponse data, response status code and response headers
37
+ def api_account_balance_get_with_http_info(opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: AccountManagementApi.api_account_balance_get ...'
40
+ end
41
+ # resource path
42
+ local_var_path = '/api/account/balance'
43
+
44
+ # query parameters
45
+ query_params = opts[:query_params] || {}
46
+
47
+ # header parameters
48
+ header_params = opts[:header_params] || {}
49
+ # HTTP header 'Accept' (if needed)
50
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
51
+ header_params[:'x-api-key'] = opts[:'x_api_key'] if !opts[:'x_api_key'].nil?
52
+
53
+ # form parameters
54
+ form_params = opts[:form_params] || {}
55
+
56
+ # http body (model)
57
+ post_body = opts[:debug_body]
58
+
59
+ # return_type
60
+ return_type = opts[:debug_return_type] || 'BalanceResponse'
61
+
62
+ # auth_names
63
+ auth_names = opts[:debug_auth_names] || []
64
+
65
+ new_options = opts.merge(
66
+ :operation => :"AccountManagementApi.api_account_balance_get",
67
+ :header_params => header_params,
68
+ :query_params => query_params,
69
+ :form_params => form_params,
70
+ :body => post_body,
71
+ :auth_names => auth_names,
72
+ :return_type => return_type
73
+ )
74
+
75
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
76
+ if @api_client.config.debugging
77
+ @api_client.config.logger.debug "API called: AccountManagementApi#api_account_balance_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
78
+ end
79
+ return data, status_code, headers
80
+ end
81
+ end
82
+ end