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_BASE_URL (optional, default https://api.dialnexa.com)

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

DIALNEXA_API_KEY=your_api_key

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")

# 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")  # reads DIALNEXA_API_KEY, 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
# List calls (pagination: defaults page=1, limit=30)
print(client.calls.list(page=1, limit=30))
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.1.tar.gz (6.6 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.1-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dialnexa-0.1.1.tar.gz
  • Upload date:
  • Size: 6.6 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.1.tar.gz
Algorithm Hash digest
SHA256 f1c8d1194534488e38f3757d91401788fb4c5c6e6923661468586d8ba5d8f614
MD5 8ab0227cd927b48f4b5e138f4c7ad60c
BLAKE2b-256 f31102a869708bef60597aaf7456ff613fc478f4073bfd5dac9220fd5383c51c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dialnexa-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.9 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 da465c47ad3dc79a1158d7a49e3be4657ca68f3238707c184183a8da7a3d48c1
MD5 4b318c2ce1bfe0dbf81a9030656e8cdb
BLAKE2b-256 35a08c783c4b1d063a3ff62ac78455cdc156ace69682cb9327dbde81d0de5117

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