{"id":15160838,"url":"https://github.com/rageagainstthepixel/com.rest.blockadelabs","last_synced_at":"2025-09-30T12:30:59.273Z","repository":{"id":168076789,"uuid":"617131786","full_name":"RageAgainstThePixel/com.rest.blockadelabs","owner":"RageAgainstThePixel","description":"A Non-Official Blockade Labs Rest Client for Unity (UPM)","archived":true,"fork":false,"pushed_at":"2024-07-30T16:36:59.000Z","size":523,"stargazers_count":17,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-09-27T23:24:15.755Z","etag":null,"topics":["ai","blockadelabs","generative-ai","generative-art","openupm","skybox","unity","unity3d","upm","upm-package"],"latest_commit_sha":null,"homepage":"https://skybox.blockadelabs.com/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RageAgainstThePixel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"StephenHodgson","patreon":"RageAgainstThePixel"}},"created_at":"2023-03-21T19:02:54.000Z","updated_at":"2024-07-30T16:37:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"e72319c9-7222-4f1c-9669-09dba7b0111f","html_url":"https://github.com/RageAgainstThePixel/com.rest.blockadelabs","commit_stats":null,"previous_names":["rageagainstthepixel/com.rest.blockadelabs"],"tags_count":17,"template":false,"template_full_name":"RageAgainstThePixel/upm-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RageAgainstThePixel%2Fcom.rest.blockadelabs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RageAgainstThePixel%2Fcom.rest.blockadelabs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RageAgainstThePixel%2Fcom.rest.blockadelabs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RageAgainstThePixel%2Fcom.rest.blockadelabs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RageAgainstThePixel","download_url":"https://codeload.github.com/RageAgainstThePixel/com.rest.blockadelabs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234737807,"owners_count":18879179,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","blockadelabs","generative-ai","generative-art","openupm","skybox","unity","unity3d","upm","upm-package"],"created_at":"2024-09-26T23:24:22.756Z","updated_at":"2025-09-30T12:30:58.877Z","avatar_url":"https://github.com/RageAgainstThePixel.png","language":"C#","funding_links":["https://github.com/sponsors/StephenHodgson","https://patreon.com/RageAgainstThePixel"],"categories":[],"sub_categories":[],"readme":"# com.rest.blockadelabs\n\nNotice of Archival: This repository has now been integrated with the [Official BlockadeLabs SDK](https://github.com/Blockade-Games/BlockadeLabs-SDK-Unity) v2.0.0\n\n***All copyrights, trademarks, logos, and assets are the property of their respective owners.***\n\n## Installing\n\nRequires Unity 2021.3 LTS or higher.\n\nThe recommended installation method is though the unity package manager and [OpenUPM](https://openupm.com/packages/com.rest.blockadelabs).\n\n### Via Unity Package Manager and OpenUPM\n\n- Open your Unity project settings\n- Select the `Package Manager`\n![scoped-registries](BlockadeLabs/Packages/com.rest.blockadelabs/Documentation~/images/package-manager-scopes.png)\n- Add the OpenUPM package registry:\n  - Name: `OpenUPM`\n  - URL: `https://package.openupm.com`\n  - Scope(s):\n    - `com.rest.blockadelabs`\n    - `com.utilities`\n- Open the Unity Package Manager window\n- Change the Registry from Unity to `My Registries`\n- Add the `BlockadeLabs` package\n\n### Via Unity Package Manager and Git url\n\n- Open your Unity Package Manager\n- Add package from git url: `https://github.com/RageAgainstThePixel/com.rest.blockadelabs.git#upm`\n  \u003e Note: this repo has dependencies on other repositories! You are responsible for adding these on your own.\n  - [com.utilities.async](https://github.com/RageAgainstThePixel/com.utilities.async)\n  - [com.utilities.extensions](https://github.com/RageAgainstThePixel/com.utilities.extensions)\n  - [com.utilities.rest](https://github.com/RageAgainstThePixel/com.utilities.rest)\n\n## Documentation\n\n### Table of Contents\n\n- [Authentication](#authentication)\n- [Editor Dashboard](#editor-dashboard)\n  - [Skybox Dashboard](#skybox-dashboard)\n  - [History Dashboard](#history-dashboard)\n- [Skyboxes](#skyboxes)\n  - [Get Skybox Styles](#get-skybox-styles)\n  - [Get Skybox Style Families](#get-skybox-style-families)\n  - [Get Skybox Export Options](#get-skybox-export-options)\n  - [Generate Skybox](#generate-skybox) :construction: :warning:\n  - [Get Skybox by Id](#get-skybox)\n  - [Request Skybox Export](#request-skybox-export)\n  - [Delete Skybox by Id](#delete-skybox)\n  - [Get Skybox History](#get-skybox-history)\n  - [Cancel Skybox Generation](#cancel-skybox-generation)\n  - [Cancel All Pending Skybox Generations](#cancel-all-pending-skybox-generations)\n\n### Authentication\n\nThere are 4 ways to provide your API keys, in order of precedence:\n\n\u003e [!WARNING]\n\u003e We recommended using the environment variables to load the API key instead of having it hard coded in your source. It is not recommended use this method in production, but only for accepting user credentials, local testing and quick start scenarios.\n\n1. [Pass keys directly with constructor](#pass-keys-directly-with-constructor) :warning:\n2. [Unity Scriptable Object](#unity-scriptable-object) :warning:\n3. [Load key from configuration file](#load-key-from-configuration-file)\n4. [Use System Environment Variables](#use-system-environment-variables)\n\n#### Pass keys directly with constructor\n\n```csharp\nvar api = new BlockadeLabsClient(\"yourApiKey\");\n```\n\nOr create a `BlockadeLabsAuthentication` object manually\n\n```csharp\nvar api = new BlockadeLabsClient(new BlockadeLabsAuthentication(\"yourApiKey\"));\n```\n\n#### Unity Scriptable Object\n\nYou can save the key directly into a scriptable object that is located in the `Assets/Resources` folder.\n\nYou can create a new one by using the context menu of the project pane and creating a new `BlockadeLabsConfiguration` scriptable object.\n\n![Create new BlockadeLabsConfiguration](BlockadeLabs/Packages/com.rest.blockadelabs/Documentation~/images/create-scriptable-object.png)\n\n#### Load key from configuration file\n\nAttempts to load api keys from a configuration file, by default `.blockadelabs` in the current directory, optionally traversing up the directory tree or in the user's home directory.\n\nTo create a configuration file, create a new text file named `.blockadelabs` and containing the line:\n\n##### Json format\n\n```json\n{\n  \"apiKey\": \"yourApiKey\",\n}\n```\n\nYou can also load the file directly with known path by calling a static method in Authentication:\n\n```csharp\nvar api = new BlockadeLabsClient(new BlockadeLabsAuthentication().LoadFromDirectory(\"your/path/to/.blockadelabs\"));;\n```\n\n#### Use System Environment Variables\n\nUse your system's environment variables specify an api key to use.\n\n- Use `BLOCKADELABS_API_KEY` for your api key.\n\n```csharp\nvar api = new BlockadeLabsClient(new BlockadeLabsAuthentication().LoadFromEnvironment());\n```\n\n### Editor Dashboard\n\nYou can perform all of the same actions from the BlockadeLabs website, in the Editor using the BlockadeLabs Dashboard!\n\n`Window/Dashboards/BlockadeLabs`\n\n![dashboard](BlockadeLabs/Packages/com.rest.blockadelabs/Documentation~/images/dashboard.png)\n\n#### Skybox Dashboard\n\nGenerate skyboxes and remix them directly in the editor.\n\n![History](BlockadeLabs/Packages/com.rest.blockadelabs/Documentation~/images/skybox-editor.png)\n\n#### History Dashboard\n\nYou also have access to the full list of all your generated skyboxes, ready for downloading directly into your project.\n\n![History](BlockadeLabs/Packages/com.rest.blockadelabs/Documentation~/images/history-editor.png)\n\n### Skyboxes\n\n#### [Get Skybox Styles](https://api-documentation.blockadelabs.com/api/skybox.html#get-skybox-styles)\n\nReturns the list of predefined styles that can influence the overall aesthetic of your skybox generation.\n\n```csharp\nvar api = new BlockadeLabsClient();\nvar skyboxStyles = await api.SkyboxEndpoint.GetSkyboxStylesAsync(SkyboxModel.Model3);\n\nforeach (var skyboxStyle in skyboxStyles)\n{\n    Debug.Log($\"{skyboxStyle.Name}\");\n}\n```\n\n#### [Get Skybox Style Families](https://api-documentation.blockadelabs.com/api/skybox.html#get-skybox-style-families)\n\nReturns the list of predefined styles that can influence the overall aesthetic of your skybox generation, sorted by style family. This route can be used in order to build a menu of styles sorted by family.\n\n```csharp\nvar api = new BlockadeLabsClient();\nvar skyboxFamilyStyles = await BlockadeLabsClient.SkyboxEndpoint.GetSkyboxStyleFamiliesAsync(SkyboxModel.Model3);\n\nforeach (var skyboxStyle in skyboxFamilyStyles)\n{\n    Debug.Log($\"{skyboxStyle.Name}\");\n}\n```\n\n#### [Get Skybox Export Options](https://api-documentation.blockadelabs.com/api/skybox-exports.html#get-export-types)\n\nReturns the list of all available export types.\n\n```csharp\nvar api = new BlockadeLabsClient();\nvar exportOptions = await api.SkyboxEndpoint.GetAllSkyboxExportOptionsAsync();\n\nforeach (var exportOption in exportOptions)\n{\n    Debug.Log($\"{exportOption.Id}: {exportOption.Name} | {exportOption.Key}\");\n}\n\nvar request = new SkyboxRequest(\"mars\", enhancePrompt: true);\n// Generates ALL export options for the skybox\nvar skyboxInfo = await api.SkyboxEndpoint.GenerateSkyboxAsync(request, exportOptions);\nDebug.Log($\"Successfully created skybox: {skyboxInfo.Id}\");\n```\n\n#### [Generate Skybox](https://api-documentation.blockadelabs.com/api/skybox.html#generate-skybox)\n\nGenerate a skybox.\n\n```csharp\nvar api = new BlockadeLabsClient();\nvar skyboxStyles = await BlockadeLabsClient.SkyboxEndpoint.GetSkyboxStylesAsync(SkyboxModel.Model3);\nvar request = new SkyboxRequest(skyboxStyles.First(), \"mars\", enhancePrompt: true);\n\n// You can also get progress callbacks when the generation progress has changed/updated\nvar progress = new Progress\u003cSkyboxInfo\u003e(async progress =\u003e\n{\n    Debug.Log(progress);\n});\n\nvar skyboxInfo = await api.SkyboxEndpoint.GenerateSkyboxAsync(request, progressCallback: progress);\nDebug.Log($\"Successfully created skybox: {skyboxInfo.Id}\");\n\nif (skyboxInfo.TryGetAsset\u003cTexture2D\u003e(SkyboxExportOption.Equirectangular_PNG, out var texture))\n{\n    skyboxMaterial.mainTexture = texture;\n}\n```\n\n#### [Get Skybox](https://api-documentation.blockadelabs.com/api/skybox.html#get-skybox-by-id)\n\nReturns the skybox metadata for the given skybox id.\n\n```csharp\nvar skyboxId = 42;\nvar api = new BlockadeLabsClient();\nvar skyboxInfo = await api.SkyboxEndpoint.GetSkyboxInfoAsync(skyboxId);\nDebug.Log($\"Skybox: {result.Id}\");\n// Note: If you wish to use the returned skybox info textures you'll need to additionally call await SkyboxInfo.LoadAssetsAsync(); before you can assign them to a material property.\nawait skyboxInfo.LoadAssetsAsync();\n\nif (skyboxInfo.TryGetAsset\u003cTexture2D\u003e(SkyboxExportOption.Equirectangular_PNG, out var texture))\n{\n    skyboxMaterial.mainTexture = texture;\n}\n```\n\n#### [Request Skybox Export](https://api-documentation.blockadelabs.com/api/skybox-exports.html#request-export)\n\nExports the skybox with the requested export type.\n\n\u003e [!NOTE]\n\u003e You can also specify the export types when initially generating a skybox.\n\n```csharp\nvar skyboxId = 42;\nvar api = new BlockadeLabsClient();\nvar skyboxInfo = await api.SkyboxEndpoint.GetSkyboxInfoAsync(skyboxId);\nskyboxInfo = await api.SkyboxEndpoint.ExportSkyboxAsync(skyboxInfo, DefaultExportOptions.DepthMap_PNG);\nawait skyboxInfo.LoadAssetsAsync();\n\nif (skyboxInfo.TryGetAsset\u003cTexture2D\u003e(SkyboxExportOption.DepthMap_PNG, out var texture))\n{\n    skyboxMaterial.depthTexture = texture;\n}\n```\n\n#### [Delete Skybox](https://api-documentation.blockadelabs.com/api/skybox.html#delete)\n\nDeletes a skybox by id.\n\n```csharp\nvar skyboxId = 42;\nvar result = await api.SkyboxEndpoint.DeleteSkyboxAsync(skybox);\n// result == true\n```\n\n#### [Get Skybox History](https://api-documentation.blockadelabs.com/api/skybox.html#get-history)\n\nGets the previously generated skyboxes.\n\n```csharp\nvar history = await api.SkyboxEndpoint.GetSkyboxHistoryAsync();\nDebug.Log($\"Found {history.TotalCount} skyboxes\");\n\nforeach (var skybox in history.Skyboxes)\n{\n    Debug.Log($\"{skybox.Id} {skybox.Title} status: {skybox.Status}\");\n}\n```\n\n#### [Cancel Skybox Generation](https://api-documentation.blockadelabs.com/api/skybox.html#cancel-generation)\n\nCancels a pending skybox generation request by id.\n\n```csharp\nvar skyboxId = 42;\nvar result = await CancelSkyboxGenerationAsync(skyboxId);\n// result == true\n```\n\n\u003e [!NOTE]\n\u003e This is automatically done when cancelling a skybox generation using cancellation token.\n\n#### [Cancel All Pending Skybox Generations](https://api-documentation.blockadelabs.com/api/skybox.html#cancel-all-pending-generations)\n\nCancels ALL pending skybox generation requests.\n\n```csharp\nvar result = await api.SkyboxEndpoint.CancelAllPendingSkyboxGenerationsAsync();\nDebug.Log(result ? \"All pending generations successfully cancelled\" : \"No pending generations\");\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frageagainstthepixel%2Fcom.rest.blockadelabs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frageagainstthepixel%2Fcom.rest.blockadelabs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frageagainstthepixel%2Fcom.rest.blockadelabs/lists"}