### Go Image Generation Example Source: https://docs.nexos.ai/openai-sdks/go-sdk This Go code snippet demonstrates how to generate an image using the Nexos AI Go SDK. It uses the 'dall-e-3' model and a text prompt to create an image, returning its URL. ```Go package main import ( "context" "fmt" "os" "github.com/joho/godotenv" "github.com/openai/openai-go" "github.com/openai/openai-go/option" ) func main() { err := godotenv.Load() if err != nil { panic(err) } apiKey := os.Getenv("API_KEY") apiUrl := os.Getenv("API_URL") client := openai.NewClient( option.WithBaseURL(apiUrl), option.WithAPIKey(apiKey), ) response, err := client.Images.Generate(context.Background(), openai.ImageGenerateParams{ Model: "dall-e-3", Prompt: "three letters 'r' with strawberry texture", }) if err != nil { panic(err) } fmt.Println(response.Data[0].URL) } ``` -------------------------------- ### Go Chat Completion Example Source: https://docs.nexos.ai/openai-sdks/go-sdk This Go code snippet demonstrates how to perform a chat completion using the Nexos AI Go SDK. It requires API key and URL from environment variables and uses the 'gpt-3.5-turbo' model. ```Go package main import ( "context" "fmt" "os" "github.com/joho/godotenv" "github.com/openai/openai-go" "github.com/openai/openai-go/option" ) func main() { err := godotenv.Load() if err != nil { panic(err) } apiKey := os.Getenv("API_KEY") apiUrl := os.Getenv("API_URL") client := openai.NewClient( option.WithBaseURL(apiUrl), option.WithAPIKey(apiKey), ) response, err := client.Chat.Completions.New(context.Background(), openai.ChatCompletionNewParams{ Model: "gpt-3.5-turbo", Messages: []openai.ChatCompletionMessageParamUnion{ openai.UserMessage("how many letters 'r' in the word 'strawberry'"), }, }) if err != nil { panic(err) } fmt.Println(response.Choices[0].Message.Content) } ``` -------------------------------- ### Go Audio Transcription Example Source: https://docs.nexos.ai/openai-sdks/go-sdk This Go code snippet demonstrates how to transcribe audio using the Nexos AI Go SDK. It takes an audio file ('sound.mp3') and uses the 'whisper-1' model to convert speech to text. ```Go package main import ( "context" "fmt" "os" "github.com/joho/godotenv" "github.com/openai/openai-go" "github.com/openai/openai-go/option" ) func main() { err := godotenv.Load() if err != nil { panic(err) } apiKey := os.Getenv("API_KEY") apiUrl := os.Getenv("API_URL") client := openai.NewClient( option.WithBaseURL(apiUrl), option.WithAPIKey(apiKey), ) file, err := os.Open("sound.mp3") if err != nil { panic(err) } defer file.Close() response, err := client.Audio.Transcriptions.New(context.Background(), openai.AudioTranscriptionNewParams{ Model: "whisper-1", File: file, }) if err != nil { panic(err) } fmt.Println(response.Text) } ``` -------------------------------- ### Go Audio Generation Example Source: https://docs.nexos.ai/openai-sdks/go-sdk This Go code snippet shows how to generate audio using the Nexos AI Go SDK. It takes text input and converts it to speech using the 'tts-1' model, saving the output to 'generated.mp3'. ```Go package main import ( "context" "io" "os" "github.com/joho/godotenv" "github.com/openai/openai-go" "github.com/openai/openai-go/option" ) func main() { err := godotenv.Load() if err != nil { panic(err) } apiKey := os.Getenv("API_KEY") apiUrl := os.Getenv("API_URL") client := openai.NewClient( option.WithBaseURL(apiUrl), option.WithAPIKey(apiKey), ) response, err := client.Audio.Speech.New(context.Background(), openai.AudioSpeechNewParams{ Model: "tts-1", Input: "There are three letters 'r' in the word 'strawberry'.", Voice: openai.AudioSpeechNewParamsVoiceAsh, }) if err != nil { panic(err) } file, err := os.Create("generated.mp3") if err != nil { panic(err) } defer file.Close() _, err = io.Copy(file, response.Body) if err != nil { panic(err) } } ``` -------------------------------- ### Go Audio Translation Example Source: https://docs.nexos.ai/openai-sdks/go-sdk This Go code snippet shows how to translate audio using the Nexos AI Go SDK. It takes an audio file ('sound.mp3') and uses the 'whisper-1' model to translate the speech into English text. ```Go package main import ( "context" "fmt" "os" "github.com/joho/godotenv" "github.com/openai/openai-go" "github.com/openai/openai-go/option" ) func main() { err := godotenv.Load() if err != nil { panic(err) } apiKey := os.Getenv("API_KEY") apiUrl := os.Getenv("API_URL") client := openai.NewClient( option.WithBaseURL(apiUrl), option.WithAPIKey(apiKey), ) file, err := os.Open("sound.mp3") if err != nil { panic(err) } defer file.Close() response, err := client.Audio.Translations.New(context.Background(), openai.AudioTranslationNewParams{ Model: "whisper-1", File: file, }) if err != nil { panic(err) } fmt.Println(response.Text) } ``` -------------------------------- ### Python SDK: Chat Completion Source: https://docs.nexos.ai/openai-sdks/python-sdk Generates a chat completion using the OpenAI SDK. It takes a user message and a model name as input and prints the AI's response. ```Python from openai import OpenAI from openai.types.chat import ChatCompletionUserMessageParam, ChatCompletion openai = OpenAI( api_key=api_key, base_url=api_url, ) message: ChatCompletionUserMessageParam = { "role": "user", "content": "how many letters 'r' in the word 'strawberry'", } response: ChatCompletion = openai.chat.completions.create(model="gpt-3.5-turbo", messages=[message]) print(response.choices[0].message.content) ``` -------------------------------- ### Build Creative Brief Source: https://docs.nexos.ai/workspace/assistants/prompt-library Transforms scattered inputs into a structured creative brief for a team. It identifies objectives, audience, key messages, deliverables, and timelines, and can include public examples. ```English Instructions Parse inputs and detect objective, audience, single message, proof points, deliverables, timeline, mandatories. Prefer internal references if available. Pull quotes or metrics with file and page. If examples help, add two public examples labeled as external with links. If inputs are thin, output a brief with clear placeholders and a list of missing items. Brief Template: Objective Audience and insight Single message and tone Proof and references Deliverables and specs Timeline and owners Mandatories and constraints Risks and open questions ``` -------------------------------- ### Python SDK: Audio Generation Source: https://docs.nexos.ai/openai-sdks/python-sdk Generates speech audio from text using the OpenAI SDK. It takes text input, a model, and a voice type, then saves the audio to a file. ```Python from openai import OpenAI openai = OpenAI( api_key=api_key, base_url=api_url, ) response = openai.audio.speech.create( input="There are three letters 'r' in the word 'strawberry'.", model="tts-1", voice="alloy", ) response.write_to_file("generated.mp3") ``` -------------------------------- ### Python SDK: Image Generation Source: https://docs.nexos.ai/openai-sdks/python-sdk Generates an image based on a text prompt using the OpenAI SDK's DALL-E model. It takes a prompt and model name, then prints the URL of the generated image. ```Python from openai import OpenAI from openai.types.images_response import ImagesResponse openai = OpenAI( api_key=api_key, base_url=api_url, ) response: ImagesResponse = openai.images.generate( prompt="three letters 'r' with strawberry texture", model="dall-e-3", ) if response.data is not None: print(response.data[0].url) ``` -------------------------------- ### API Response Example (JSON) Source: https://docs.nexos.ai/gateway-api This JSON structure represents a successful response from the Nexos AI image API, detailing the creation timestamp and an array of generated image data, which may include base64 encoded data or URLs. ```JSON { "created": 1, "data": [ { "b64_json": "text", "revised_prompt": "text", "url": "text" } ] } ``` -------------------------------- ### Python SDK: Audio Translation Source: https://docs.nexos.ai/openai-sdks/python-sdk Translates audio from one language to English using the OpenAI SDK's Whisper model. It reads an MP3 file and prints the translated text. ```Python from openai import OpenAI openai = OpenAI(api_key=api_key, base_url=api_url) response = openai.audio.translations.create(file=open("sound.mp3", "rb"), model="whisper-1") print(response.text) ``` -------------------------------- ### Python SDK: Audio Transcription Source: https://docs.nexos.ai/openai-sdks/python-sdk Transcribes audio from a file into text using the OpenAI SDK's Whisper model. It reads an MP3 file and prints the transcribed text. ```Python from openai import OpenAI openai = OpenAI(api_key=api_key, base_url=api_url) response = openai.audio.transcriptions.create(file=open('sound.mp3', 'rb'), model='whisper-1') print(response.text) ``` -------------------------------- ### Send Chat Completion Request (JavaScript) Source: https://docs.nexos.ai/gateway-api Example of sending a chat completion request using JavaScript with the fetch API. It shows how to configure the request headers and body for the chat completions endpoint. ```javascript const fetch = require('node-fetch'); const response = await fetch("https://api.nexos.ai/v1/chat/completions", { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify({ "model": "gpt-3.5-turbo", "messages": [{"role": "user", "content": "Say this is a test!"}], "temperature": 0.7, "stream": true }) }); let data = await response.json(); ``` -------------------------------- ### Send Chat Completion Request (cURL) Source: https://docs.nexos.ai/gateway-api Example of sending a chat completion request using cURL. This demonstrates how to structure the request body with various parameters like model, messages, temperature, and stream. ```bash curl https://api.nexos.ai/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-3.5-turbo", "messages": [{"role": "user", "content": "Say this is a test!"}], "temperature": 0.7, "stream": true }' ``` -------------------------------- ### Edit Image with Mask and Prompt (Python) Source: https://docs.nexos.ai/gateway-api This snippet provides a Python example for editing an image using the Nexos AI API. It details how to structure the request with image file, prompt, model, and optional parameters like mask, number of images, response format, and size. ```Python import requests url = "https://api.nexos.ai/v1/images/edits" headers = { "Authorization": "Bearer YOUR_OAUTH2_TOKEN" } with open('image.png', 'rb') as image_file: files = { 'image': image_file } payload = { 'prompt': 'text', 'model': '6948fe4d-98ce-4f36-bc49-5f652cc07b65', # Optional: 'mask': open('mask.png', 'rb'), # Optional: 'n': 1, # Optional: 'response_format': 'url', # Optional: 'size': '256x256' } response = requests.post(url, headers=headers, files=files, data=payload) print(response.json()) ``` -------------------------------- ### Build Option Evidence Matrix Source: https://docs.nexos.ai/workspace/assistants/prompt-library Constructs a matrix comparing options based on Cost, Benefit, Risk, Effort, Confidence, and Evidence. Provides a recommendation with justifications and conditions for acceptance, listing necessary data if files are absent. ```Natural Language Processing Build a matrix: Option, Cost, Benefit, Risk, Effort, Confidence, Evidence file and location. Recommendation: one pick with 3 reasons and conditions to accept. If no files exist, fill the matrix with placeholders and explicitly list the smallest data set needed to finalize. External benchmarks allowed, label external. ``` -------------------------------- ### Get Storage File Details Source: https://docs.nexos.ai/gateway-api Retrieve details of a specific file from storage using its ID. Requires authorization and specifies the file_id as a path parameter. Returns file metadata upon success. ```cURL GET /v1/storage/{file_id} HTTP/1.1 Host: api.nexos.ai Authorization: Bearer YOUR_OAUTH2_TOKEN Accept: */* ``` ```JavaScript fetch("https://api.nexos.ai/v1/storage/{file_id}", { method: "GET", headers: { "Authorization": "Bearer YOUR_OAUTH2_TOKEN", "Accept": "*/*" } }) ``` ```Python import requests headers = { "Authorization": "Bearer YOUR_OAUTH2_TOKEN", "Accept": "*/*" } response = requests.get("https://api.nexos.ai/v1/storage/{file_id}", headers=headers) print(response.json()) ``` -------------------------------- ### Marketing Assistant (Project-Aware) Source: https://docs.nexos.ai/workspace/assistants/prompt-library Acts as a project-aware marketer, answering queries using project files while adhering to company voice and formatting. It labels external sources and flags missing context. Web search may be used for trends but must be clearly marked as external. ```English You handle all marketing queries using the materials in this Project. Always follow the {COMPANY} custom instructions for tone and formatting. Your responses should be concise, aligned with our brand voice, and based on proven data from past campaigns. When relevant, you may use web search to find fresh trends or examples, but clearly mark anything that comes from outside the Project. If context is missing, say so directly and recommend what should be added. ``` -------------------------------- ### Send Chat Completion Request (Python) Source: https://docs.nexos.ai/gateway-api Example of sending a chat completion request using Python's requests library. This code snippet illustrates how to make a POST request with JSON payload to the API. ```python import openai openai.api_key = "YOUR_API_KEY" response = openai.ChatCompletion.create( model="gpt-3.5-turbo", messages=[ {"role": "user", "content": "Say this is a test!"} ], temperature=0.7, stream=True ) ``` -------------------------------- ### Marketing Assistant (Performance Metrics) Source: https://docs.nexos.ai/workspace/assistants/prompt-library Computes first-order Average Order Value (AOV), Customer Acquisition Cost (CAC), and Return on Ad Spend (ROAS) by channel, campaign, ad set, and creative. It ranks performance, provides insights and actions, and cites file names and dates. Missing UTM mapping or cost data requires specific file recommendations. ```English You evaluate acquisition performance from this Project’s orders and ad exports. Compute first order AOV, CAC, and ROAS by channel, campaign, ad set, and creative. Rank winners and underperformers. If benchmarks are useful, pull them via web search and label as external. Output: metric table first, insights second, actions third. Cite file names and date ranges. If UTM mapping or cost data is missing, state the exact mapping or file required. No speculation. Show calculations clearly. ``` -------------------------------- ### Story Point Packer Assistant Source: https://docs.nexos.ai/workspace/assistants/prompt-library Converts requirements into INVEST-compliant user stories, including acceptance criteria and edge cases. It outputs a backlog grouped by epic and priority, noting dependencies. If context is limited, it asks up to two questions before proceeding with assumptions. ```English Instructions From inputs given, requirement notes and any UX artifacts. help me with: For each story write As a, I want, so that, plus 3 to 5 acceptance criteria and edge cases. Output a backlog grouped by epic and priority. Include dependencies where obvious. If context is thin, ask up to 2 questions, then proceed with tagged assumptions. ``` -------------------------------- ### Assemble Meeting Pre-reads Source: https://docs.nexos.ai/workspace/assistants/prompt-library Assembles concise pre-read documents for meetings, including a summary, key facts and metrics, questions to resolve, and source links. If no project data is available, it creates a template with placeholders and a list of required inputs. ```Natural Language Processing Assemble a pre-read. Sections and caps: -summary 120 words -key facts and metrics (max 7 bullets) with citations -questions to resolve (max 5) - links to sources with file and page or sheet If Project has nothing, build the frame with placeholders and a short list of must-have inputs. External data allowed, label external. ``` -------------------------------- ### Translate Audio to English Text Source: https://docs.nexos.ai/gateway-api Translates audio files into English text. Supports various audio formats and allows for optional prompts to guide the translation. The response format can be customized to JSON, text, SRT, or VTT. ```HTTP POST /v1/audio/translations HTTP/1.1 Host: api.nexos.ai Authorization: Bearer YOUR_OAUTH2_TOKEN Content-Type: multipart/form-data Accept: */* Content-Length: 121 { "file": "binary", "model": "6948fe4d-98ce-4f36-bc49-5f652cc07b65", "prompt": "text", "response_format": "json", "temperature": 0 } ``` ```cURL curl -X POST https://api.nexos.ai/v1/audio/translations \ -H "Authorization: Bearer YOUR_OAUTH2_TOKEN" \ -H "Content-Type: multipart/form-data" \ -F "file=@your_audio.flac" \ -F "model=6948fe4d-98ce-4f36-bc49-5f652cc07b65" \ -F "prompt=text" \ -F "response_format=json" \ -F "temperature=0" ``` ```JavaScript const axios = require('axios'); const fs = require('fs'); const translateAudio = async () => { const formData = new FormData(); formData.append('file', fs.createReadStream('your_audio.flac')); formData.append('model', '6948fe4d-98ce-4f36-bc49-5f652cc07b65'); formData.append('prompt', 'text'); formData.append('response_format', 'json'); formData.append('temperature', 0); try { const response = await axios.post('https://api.nexos.ai/v1/audio/translations', formData, { headers: { 'Authorization': 'Bearer YOUR_OAUTH2_TOKEN', 'Content-Type': 'multipart/form-data', }, }); console.log(response.data); } catch (error) { console.error('Error translating audio:', error); } }; translateAudio(); ``` ```Python import requests url = "https://api.nexos.ai/v1/audio/translations" headers = { "Authorization": "Bearer YOUR_OAUTH2_TOKEN" } files = { "file": open("your_audio.flac", "rb") } data = { "model": "6948fe4d-98ce-4f36-bc49-5f652cc07b65", "prompt": "text", "response_format": "json", "temperature": 0 } response = requests.post(url, headers=headers, files=files, data=data) if response.status_code == 200: print(response.json()) else: print(f"Error: {response.status_code}, {response.text}") ``` -------------------------------- ### Generate Market View from Project Reports Source: https://docs.nexos.ai/workspace/assistants/prompt-library Creates a concise market overview from project reports, including key findings, competitor analysis, and risk assessment. It can also label and cite external news sources. ```English You produce a short market view based on reports and notes in this Project. Start with key findings, then competitor table, then risks and opportunities. If fresh news matters, use web search, label as external, and link it. Cite report file names and page numbers where possible. If a claim cannot be verified in Project materials, say so. ``` -------------------------------- ### Provide Legal Clause Explanations Source: https://docs.nexos.ai/workspace/assistants/prompt-library Extracts exact clauses from contracts and policies within a project and provides a plain-language explanation. It also notes exceptions and cites external public law references. ```English Answer using contracts and policies in this Project. Start with a direct answer, then quote the clause with file and location. Explain in plain language, note exceptions. If you reference public law, label external and link. If the contract is missing, name it and stop. ``` -------------------------------- ### Generate Market Snapshot Source: https://docs.nexos.ai/workspace/assistants/prompt-library Produces a concise market snapshot including size, trends, key players, and risks, using project reports and notes. It can incorporate external news and cite sources. ```English Produce a snapshot using reports and notes in this Project. Start with key findings, then competitor table, then risks and opportunities. If fresh news matters, search the web, label external, link. Cite report files and pages. If a claim cannot be verified here, say so. ``` -------------------------------- ### Outcome KPI Setter Assistant Source: https://docs.nexos.ai/workspace/assistants/prompt-library Defines success metrics and guardrails for initiatives by establishing a north star metric, key drivers, and guardrails. It provides formulas, data sources, and a KPI table with ownership and review cadence. If data is missing, it recommends a minimal tracking plan. ```English Define one north star, 3 to 5 drivers, and 2 guardrails. Provide formulas and data sources. Output: KPI table with owner and review cadence risks if gamed and how to counter sources or schema request If data does not exist, recommend a minimal tracking plan. ``` -------------------------------- ### Generate Executive One-Pager Source: https://docs.nexos.ai/workspace/assistants/prompt-library Creates a concise one-page summary for leaders, including facts, metrics, risks, opportunities, questions, and asks with dates. It cites internal sources or provides placeholders and a checklist for missing data, keeping prose under 250 words. ```Natural Language Processing Sections in order: facts and metrics, top risks, opportunities, open questions, asks with dates. Cite internal sources inline. If none exist, produce the sections with placeholders and a checklist of the minimum data to finalize. Keep prose under 250 words total. External items must be labeled. ``` -------------------------------- ### Analyze Competitor Messaging and Strategy Source: https://docs.nexos.ai/workspace/assistants/prompt-library Extracts and summarizes competitor messaging, product changes, pricing, and partnerships from project notes. It suggests response ideas and labels external information. ```English From this Project’s competitive notes, and our listed competitors, extract the main messaging in their homepages and shifts. Summarize product changes, pricing, messaging, partnerships. Add 3 response ideas tied to our positioning. Any public items must be labeled external with links. If a competitor file is missing, or you need more information - tell me. You always offer outside of the box solutions to approach our competition. ``` -------------------------------- ### Generate Speech Audio from Text (JavaScript) Source: https://docs.nexos.ai/gateway-api This JavaScript snippet demonstrates how to use the Fetch API to call the Nexos AI /v1/audio/speech endpoint. It sends a POST request with a JSON body containing the model, input text, voice, response format, and speed. ```JavaScript const options = { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_OAUTH2_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ model: '6948fe4d-98ce-4f36-bc49-5f652cc07b65', input: 'text', voice: 'alloy', response_format: 'mp3', speed: 1 }) }; fetch('https://api.nexos.ai/v1/audio/speech', options) .then(response => response.blob()) // Assuming the response is binary audio data .then(blob => { // Handle the audio blob, e.g., play it or save it const url = window.URL.createObjectURL(blob); const audio = new Audio(url); audio.play(); }) .catch(error => console.error('Error:', error)); ``` -------------------------------- ### Upgrade Macro Library Source: https://docs.nexos.ai/workspace/assistants/prompt-library Enhances a macro library for faster and more consistent customer support replies. It merges duplicates, adds variants, and inserts variables based on existing macros, tickets, and policy documents. ```English Inputs accepted: existing macros, recent tickets, policy PDFs. Build: 1. merge duplicate macros 2. add missing variants for top 5 issues 3. insert variables and guardrails Output: macro set with titles and bodies mapping text to issues gaps list with sources If no macros exist, create a starter set based on ticket patterns. ``` -------------------------------- ### Review DPA Readiness Source: https://docs.nexos.ai/workspace/assistants/prompt-library Assists in reviewing draft Data Processing Agreements (DPAs) to ensure they meet customer expectations. It checks critical sections and provides a structured output with status, evidence, and suggested fixes. ```English Inputs accepted: draft DPA, security overview. Checklist sections: roles, subprocessors, transfer mechanism, security measures, breach notice, audit rights, deletion, liability, governing law. Output: -checklist: item, status, evidence, gap, suggested fix - Red flag summary in 80 words Cite section and page for each item. If a section is missing, state it plainly. ``` -------------------------------- ### Product Strategy Evaluation Assistant Source: https://docs.nexos.ai/workspace/assistants/prompt-library Evaluates a product strategy by comparing it to market offerings, identifying shortcomings, and performing KANO and MoSCoW prioritization. It requires clarification of scope and can ask up to three questions if goals, users, or constraints are unclear. The output includes a product summary, market scan, gap analysis, KANO classification, and MoSCoW prioritization. ```English Follow {COMPANY} custom instructions for tone, terminology, and confidentiality. Clarify scope first. Ask up to 3 precise questions if goals, target users, or constraints are unclear. If answers are not available, proceed with clearly tagged assumptions. 1. Build a concise product summary: target users and primary jobs to be done current solution overview and key flows success metrics used today if provided 2. Run a focused market scan: if competitor names or docs are provided, use them first if not, request names the team considers peers only when helpful, use web search, label findings as external, and include links compile a short table: competitor, segment, core claim, pricing signal, notable strengths, notable weaknesses 3. Perform a gap analysis on our solution. Organize gaps by category: usability, capability, performance, integration, security and compliance, trust, pricing and packaging. For each gap add severity, evidence, and quick fix or experiment. 4. Produce KANO classification for missing or underperforming features: categories: must-have, performance, delighter, indifferent, reverse table columns: feature, user outcome, category, evidence source or assumption, risk if omitted summary: what must be fixed now to avoid dissatisfaction, what can differentiate, what to avoid 5. Produce MoSCoW prioritization for the backlog: groups: must, should, could, won’t for now include dependency or enabling work where relevant table columns: item, rationale, dependency, estimate range if available Do not guess facts. Keep rationales short and specific. Where data is missing, state exactly what file or field would resolve the uncertainty. ``` -------------------------------- ### Transcribe Audio to Text (Python) Source: https://docs.nexos.ai/gateway-api This Python snippet demonstrates audio transcription using the `requests` library. It sends a POST request with `multipart/form-data` to the Nexos AI API, including the audio file and transcription parameters. ```Python import requests url = "https://api.nexos.ai/v1/audio/transcriptions" headers = { "Authorization": "Bearer YOUR_OAUTH2_TOKEN" } files = { 'file': open('/path/to/your/audio.mp3', 'rb') } data = { "model": "6948fe4d-98ce-4f36-bc49-5f652cc07b65", "language": "en", "response_format": "json", "temperature": 0, "timestamp_granularities[]": "word" } response = requests.post(url, headers=headers, files=files, data=data) if response.status_code == 200: print("Transcription successful:", response.json()) else: print(f"Error: {response.status_code}, {response.text}") ``` -------------------------------- ### List Available Models Source: https://docs.nexos.ai/gateway-api Retrieve a list of all models available to the user. This endpoint requires authorization and returns a list of model objects, each containing details like ID, name, and ownership. ```cURL GET /v1/models HTTP/1.1 Host: api.nexos.ai Authorization: Bearer YOUR_OAUTH2_TOKEN Accept: */* ``` ```JavaScript fetch("https://api.nexos.ai/v1/models", { method: "GET", headers: { "Authorization": "Bearer YOUR_OAUTH2_TOKEN", "Accept": "*/*" } }) ``` ```Python import requests headers = { "Authorization": "Bearer YOUR_OAUTH2_TOKEN", "Accept": "*/*" } response = requests.get("https://api.nexos.ai/v1/models", headers=headers) print(response.json()) ``` -------------------------------- ### Draft Project Scope and Plan Source: https://docs.nexos.ai/workspace/assistants/prompt-library Transforms problem statements from files and user prompts into a project scope, including deliverables, acceptance criteria, timeline, owners, and risks. It can search the web for patterns, label external sources, and identify missing inputs. ```Natural Language Processing From problem statements in files and my prompts, help to draft scope, deliverables, acceptance criteria, timeline, owners, and risks. If you need patterns, search the web, label external, link. List any missing inputs by file or field and stop. ``` -------------------------------- ### Generate Images from Text Prompt Source: https://docs.nexos.ai/gateway-api Generates images based on a provided text description. Users can specify the number of images, quality, format, size, and style. The response includes a URL or base64 encoded JSON of the generated image(s). ```HTTP POST /v1/images/generations HTTP/1.1 Host: api.nexos.ai Authorization: Bearer YOUR_OAUTH2_TOKEN Content-Type: application/json Accept: */* Content-Length: 148 { "prompt": "text", "model": "6948fe4d-98ce-4f36-bc49-5f652cc07b65", "n": 1, "quality": "standard", "response_format": "url", "size": "256x256", "style": "vivid" } ``` ```cURL curl -X POST https://api.nexos.ai/v1/images/generations \ -H "Authorization: Bearer YOUR_OAUTH2_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "prompt": "text", "model": "6948fe4d-98ce-4f36-bc49-5f652cc07b65", "n": 1, "quality": "standard", "response_format": "url", "size": "256x256", "style": "vivid" }' ``` ```JavaScript const axios = require('axios'); const generateImage = async () => { const data = { prompt: 'text', model: '6948fe4d-98ce-4f36-bc49-5f652cc07b65', n: 1, quality: 'standard', response_format: 'url', size: '256x256', style: 'vivid' }; try { const response = await axios.post('https://api.nexos.ai/v1/images/generations', data, { headers: { 'Authorization': 'Bearer YOUR_OAUTH2_TOKEN', 'Content-Type': 'application/json', }, }); console.log(response.data); } catch (error) { console.error('Error generating image:', error); } }; generateImage(); ``` ```Python import requests url = "https://api.nexos.ai/v1/images/generations" headers = { "Authorization": "Bearer YOUR_OAUTH2_TOKEN", "Content-Type": "application/json" } data = { "prompt": "text", "model": "6948fe4d-98ce-4f36-bc49-5f652cc07b65", "n": 1, "quality": "standard", "response_format": "url", "size": "256x256", "style": "vivid" } response = requests.post(url, headers=headers, json=data) if response.status_code == 200: print(response.json()) else: print(f"Error: {response.status_code}, {response.text}") ``` -------------------------------- ### Normalize Scattered Notes into Themes Source: https://docs.nexos.ai/workspace/assistants/prompt-library Ingests and processes scattered notes to deduplicate, group by theme, and retain only evidence-backed points. Returns themes with insights, quotes, or evidence, and open questions, tagging each item with its source. ```Natural Language Processing Ingest scattered notes. Deduplicate, group by theme, keep only evidence-backed points. Return: themes with 1-sentence insight, quotes or evidence, open questions. Tag each item with Source file and location or Assumption. If Project is empty, build the structure from the prompt and flag evidence gaps. ``` -------------------------------- ### Convert Meeting Minutes to Actions Source: https://docs.nexos.ai/workspace/assistants/prompt-library Transforms meeting transcripts or notes into decisions and an action table (Owner, Task, Due, Status). It assigns tentative owners/dates when missing and cites timestamps or pages. Provides a blank template if no notes exist. ```Natural Language Processing Turn transcripts or notes into: -decisions -action table Owner, Task, Due, Status -blockers and dependencies Rules: assign tentative owners or dates only when missing and mark as tentative. Cite timestamps or pages when possible. If no notes exist, return a blank template with a 3-line guide on how to capture them next time. ``` -------------------------------- ### Generate Speech Audio from Text (Python) Source: https://docs.nexos.ai/gateway-api This Python snippet shows how to use the `requests` library to interact with the Nexos AI /v1/audio/speech endpoint. It sends a POST request with the necessary headers and a JSON payload for speech generation. ```Python import requests url = "https://api.nexos.ai/v1/audio/speech" headers = { "Authorization": "Bearer YOUR_OAUTH2_TOKEN", "Content-Type": "application/json" } data = { "model": "6948fe4d-98ce-4f36-bc49-5f652cc07b65", "input": "text", "voice": "alloy", "response_format": "mp3", "speed": 1 } response = requests.post(url, headers=headers, json=data) if response.status_code == 200: # Assuming the response is binary audio data with open("output.mp3", "wb") as audio_file: audio_file.write(response.content) print("Audio generated successfully!") else: print(f"Error: {response.status_code}, {response.text}") ``` -------------------------------- ### Mine CSAT Drivers from Conversations Source: https://docs.nexos.ai/workspace/assistants/prompt-library Analyzes static conversation exports to identify factors influencing Customer Satisfaction (CSAT) scores. It segments data, computes CSAT deltas, and surfaces top drivers and coaching themes. ```English 1.segment by channel, topic, agent, first response time, resolution time 2. compute CSAT deltas by segment 3. surface top 5 drivers, positive and negative Output: driver list with effect size example snippets with ticket ids and timestamps 3 coaching themes and macros to add or edit If key columns are missing, name them and proceed with partial analysis. ``` -------------------------------- ### Prioritize Roadmap Initiatives Source: https://docs.nexos.ai/workspace/assistants/prompt-library Prioritizes initiatives using specified scoring methods (RICE, WSJF, or MoSCoW). Outputs a table with Item, Score, Effort, Owner, Quarter, and Dependencies, indicating any missing fields required for scoring. ```Natural Language Processing Prioritize initiatives using {RICE, WSJF or MoSCoW}. Output table with Item, Score, Effort, Owner, Quarter, Dependencies. If a value is missing, state the exact field needed to score. ``` -------------------------------- ### Transcribe Audio to Text (JavaScript) Source: https://docs.nexos.ai/gateway-api This JavaScript snippet shows how to upload an audio file for transcription using the Fetch API. It sends a POST request with `multipart/form-data` and includes parameters like model, language, and response format. ```JavaScript const fileInput = document.getElementById('audioFile'); // Assuming you have an input element with id 'audioFile' const file = fileInput.files[0]; const formData = new FormData(); formData.append('file', file); formData.append('model', '6948fe4d-98ce-4f36-bc49-5f652cc07b65'); formData.append('language', 'en'); formData.append('response_format', 'json'); formData.append('temperature', 0); formData.append('timestamp_granularities[]', 'word'); const options = { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_OAUTH2_TOKEN' // Content-Type is automatically set by FormData }, body: formData }; fetch('https://api.nexos.ai/v1/audio/transcriptions', options) .then(response => response.json()) .then(data => { console.log('Transcription:', data); }) .catch(error => console.error('Error:', error)); ``` -------------------------------- ### Download Storage File Contents Source: https://docs.nexos.ai/gateway-api Download the content of a file from storage using its ID. This endpoint requires authorization and the file_id as a path parameter. The response is the binary content of the file. ```cURL GET /v1/storage/{file_id}/content HTTP/1.1 Host: api.nexos.ai Authorization: Bearer YOUR_OAUTH2_TOKEN Accept: */* ``` ```JavaScript fetch("https://api.nexos.ai/v1/storage/{file_id}/content", { method: "GET", headers: { "Authorization": "Bearer YOUR_OAUTH2_TOKEN", "Accept": "*/*" } }) ``` ```Python import requests headers = { "Authorization": "Bearer YOUR_OAUTH2_TOKEN", "Accept": "*/*" } response = requests.get("https://api.nexos.ai/v1/storage/{file_id}/content", headers=headers) # The response content will be binary data print(response.content) ``` -------------------------------- ### Extract Action Register from Sources Source: https://docs.nexos.ai/workspace/assistants/prompt-library Scans notes, tickets, and documents to extract an action register including Task, Context, Owner, Due, Dependency, Priority, and Source. It proposes defaults for missing information and ensures tasks have clear outcomes. ```Natural Language Processing Scan notes, tickets, and docs. Output a register: Task, Context, Owner, Due, Dependency, Priority, Source. Rules: propose defaults only when missing and mark tentative. No tasks without a clear outcome. If owners are unknown, suggest the most likely function and why. Cite sources when available. ``` -------------------------------- ### Generate Speech Audio from Text (HTTP) Source: https://docs.nexos.ai/gateway-api This snippet demonstrates how to generate speech audio from text using the Nexos AI API. It requires specifying the model, input text, voice, and optionally the response format and speed. ```HTTP POST /v1/audio/speech HTTP/1.1 Host: api.nexos.ai Authorization: Bearer YOUR_OAUTH2_TOKEN Content-Type: application/json Accept: */* Content-Length: 113 { "model": "6948fe4d-98ce-4f36-bc49-5f652cc07b65", "input": "text", "voice": "alloy", "response_format": "mp3", "speed": 1 } ``` -------------------------------- ### Edit Image with Mask and Prompt (HTTP/cURL) Source: https://docs.nexos.ai/gateway-api This snippet demonstrates how to edit an image using a mask and a text prompt via an HTTP POST request. It requires the image file, an optional mask file, a prompt, and a model ID. The response format and image size can also be specified. ```cURL POST /v1/images/edits HTTP/1.1 Host: api.nexos.ai Authorization: Bearer YOUR_OAUTH2_TOKEN Content-Type: multipart/form-data Accept: */* Content-Length: 144 { "image": "binary", "mask": "binary", "prompt": "text", "model": "6948fe4d-98ce-4f36-bc49-5f652cc07b65", "n": 1, "response_format": "url", "size": "256x256" } ``` -------------------------------- ### Transcribe Audio to Text (HTTP) Source: https://docs.nexos.ai/gateway-api This snippet shows the HTTP request structure for transcribing audio to text using the Nexos AI API. It uses `multipart/form-data` and includes parameters like file, model, language, response format, and temperature. ```HTTP POST /v1/audio/transcriptions HTTP/1.1 Host: api.nexos.ai Authorization: Bearer YOUR_OAUTH2_TOKEN Content-Type: multipart/form-data Accept: */* Content-Length: 176 { "file": "binary", "model": "6948fe4d-98ce-4f36-bc49-5f652cc07b65", "language": "text", "prompt": "text", "response_format": "json", "temperature": 0, "timestamp_granularities[]": [ "word" ] } ```