Skip to main content

DialNexa Python SDK

Project description

Nexa Python SDK

Install

  • Requires Python 3.8+
  • From PyPI: pip install dialnexa
  • From source (in repo root): pip install .

Environment

  • DIALNEXA_API_KEY (required)
  • DIALNEXA_ORGANIZATION_ID (required for Calls, Agents, Batch Calls, Voices)
  • DIALNEXA_BASE_URL (optional, default https://api.dialnexa.com)

You can place these in a .env file in your project root:

DIALNEXA_API_KEY=your_api_key
DIALNEXA_ORGANIZATION_ID=your_encrypted_org_id

The SDK automatically loads .env when imported.

Usage

from dialnexa import NexaClient

# Option A: pass credentials directly (no .env required)
client = NexaClient(api_key="your_api_key", organization_id="your_encrypted_org_id")

# Option B: rely on environment (.env is optional)
# from dotenv import load_dotenv
# load_dotenv()
# With env set, you can simply do:
# client = NexaClient(api_key="your_api_key_here", organization_id="your_org_id_here")  # reads DIALNEXA_API_KEY, DIALNEXA_ORGANIZATION_ID, DIALNEXA_BASE_URL

# Languages
print(client.languages.list())
print(client.languages.get("en-US"))

# LLMs
print(client.llms.list())
print(client.llms.get("llm_123"))

# Calls
created = client.calls.create(
    phone_number="+15555551234",
    agent_id="agent_123",
    agent_version_number=1,
    metadata={"source": "sdk"},
)
print(client.calls.get(created.get("call_id")))

# Batch Calls
with open("./leads.csv", "rb") as f:
    resp = client.batch_calls.create(file=f, filename="leads.csv", title="My batch", agent_id="agent_123", agent_version_number=1)
    print(resp)

# Agents
created_agent = client.agents.create({
    "title": "Customer Support Agent",
    "prompts": {
        "prompt_text": "Hello!",
        "welcome_message": "Welcome! I'm here to help.",
        "conversation_start_type": "user",
    },
})
print(created_agent)
listed = client.agents.list()
print(listed)
agent_id = created_agent.get("data", {}).get("id") or created_agent.get("data", {}).get("agent_id")
print(client.agents.get(agent_id))
print(client.agents.update(agent_id, {"version_number": 1, "title": "Updated Title"}))

# Voices
print(client.voices.list(provider_name="elevenlabs", limit=10))
print(client.voices.get("voice_abc"))

Notes

  • The default base URL is https://api.dialnexa.com. Override by passing base_url to NexaClient or setting DIALNEXA_BASE_URL.
  • Timeouts use seconds internally; pass timeout_ms to NexaClient.
  • Multipart uploads rely on requests handling for simplicity.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dialnexa-0.1.0.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dialnexa-0.1.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file dialnexa-0.1.0.tar.gz.

File metadata

  • Download URL: dialnexa-0.1.0.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for dialnexa-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5c1999e36634200acab6143235cd6f8b499ae6aa7acb535fb1ec0e2f9ff1f4c9
MD5 d8d88f99615e65ad437211390b7f5da0
BLAKE2b-256 380f90670fab83e043e57dde07d8417a5ee27f2bd13cd160fefa869f5cad3157

See more details on using hashes here.

File details

Details for the file dialnexa-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dialnexa-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for dialnexa-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e6dfa47f19f195b9789d117c215805bed81421cf354f4f7ff88d1fda71a7b8ec
MD5 745c8e62d0917cc66b574d2326258571
BLAKE2b-256 0736c666416a9e9e0f7e0493b82484011061c8f1d36a3391cba7a8adafc4b36a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page